Commits

Mike Bayer committed 028735d

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

  • Participants
  • Parent commits 1dc9a22

Comments (0)

Files changed (1)

lib/sqlalchemy/mapping/objectstore.py

     
     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