[FIX] sql_db: do not handle errors when releasing savepoint

If you commit the transaction inside the context manager `cr.savepoint()`, the
savepoint is lost.  In that case, releasing the savepoint fails.  That failure
should not be handled by rolling back to the savepoint...
This commit is contained in:
Raphael Collet
2016-01-15 17:04:45 +01:00
parent 8c3eb91e57
commit c4494b9868
+3 -2
View File
@@ -374,10 +374,11 @@ class Cursor(object):
self.execute('SAVEPOINT "%s"' % name)
try:
yield
self.execute('RELEASE SAVEPOINT "%s"' % name)
except:
except Exception:
self.execute('ROLLBACK TO SAVEPOINT "%s"' % name)
raise
else:
self.execute('RELEASE SAVEPOINT "%s"' % name)
@check
def __getattr__(self, name):