with transaction() statements have conflicting rollbacks
Bug #125118 reported by
Aaron Swartz
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
web.py |
Fix Released
|
Medium
|
Anand Chitipothu |
Bug Description
See http://
Perhaps we should take rollback out altogether?
Changed in webpy: | |
assignee: | nobody → anandology |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in webpy: | |
milestone: | none → 0.3 |
Changed in webpy: | |
status: | Confirmed → Fix Committed |
Changed in webpy: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Consider the following code:
def f():
web.rollback( )
web.commit( )
web.transact()
try:
g()
except:
else:
def g():
web.transact()
h()
web.commit()
def h():
raise Exception
Since g, didn't do rollback, the rollback in f is not really rolling back the correct transaction.
How about the following interface?
t = web.transact()
try:
web.query('blah blah blah')
except:
t.rollback()
raise
else:
t.commit()
Here we know what to rollback, so even if it is rolled back twice, it can be handled.
shall we consider it for web.py 0.3?