Adding transaction context manager function for db transactions

Implements: blueprint mistral-with-transaction
Change-Id: Ied955bd590128520aa0aea883fefa7bf8f95aa1f
Merge "Adding transaction context manager function for db transactions"