mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-05-14 20:57:19 -04:00
when begin/commit, an exception should still reset the transactional state
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user