* fix: abort transactions in response to any unhandled exception, no
transactions must be left dangling
This commit is contained in:
@@ -63,6 +63,9 @@ def txn_proc(proc, txn = None):
|
||||
except db.DBError, e:
|
||||
autotxn.abort()
|
||||
raise e
|
||||
except Exception, e:
|
||||
autotxn.abort()
|
||||
raise e
|
||||
autotxn.commit()
|
||||
else:
|
||||
retval = proc(None)
|
||||
|
||||
@@ -81,6 +81,9 @@ class DBShelf:
|
||||
except db.DBError, e:
|
||||
autotxn.abort()
|
||||
raise e
|
||||
except Exception, e:
|
||||
autotxn.abort()
|
||||
raise e
|
||||
autotxn.commit()
|
||||
else: # execute without transactions
|
||||
retval = proc(None)
|
||||
|
||||
Reference in New Issue
Block a user