Added support for transactions in database model