when begin/commit, an exception should still reset the transactional state

This commit is contained in:
Mike Bayer
2006-02-22 00:33:38 +00:00
parent 24e22e2e5a
commit eb8cd46bf5
+5 -3
View File
@@ -119,9 +119,11 @@ class Session(object):
def _trans_commit(self, trans):
if trans.uow is self.uow and trans.isactive:
self.uow.commit()
self.uow = self.parent_uow
self.parent_uow = None
try:
self.uow.commit()
finally:
self.uow = self.parent_uow
self.parent_uow = None
def _trans_rollback(self, trans):
if trans.uow is self.uow:
self.uow = self.parent_uow