Fixing the Transaction Manage so that sessions get released properly.