* fix: abort transactions in response to any unhandled exception, no

transactions must be left dangling
This commit is contained in:
Eray Özkural
2006-05-04 16:26:26 +00:00
parent 4f3bc5d000
commit 915224d2c2
2 changed files with 6 additions and 0 deletions
+3
View File
@@ -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)
+3
View File
@@ -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)