added support for transaction to the the database class. not complete.