parent
8176150850
commit
ee837b9a22
|
@ -217,7 +217,13 @@ class Atomic(object):
|
||||||
try:
|
try:
|
||||||
connection.savepoint_commit(sid)
|
connection.savepoint_commit(sid)
|
||||||
except DatabaseError:
|
except DatabaseError:
|
||||||
connection.savepoint_rollback(sid)
|
try:
|
||||||
|
connection.savepoint_rollback(sid)
|
||||||
|
except Error:
|
||||||
|
# If rolling back to a savepoint fails, mark for
|
||||||
|
# rollback at a higher level and avoid shadowing
|
||||||
|
# the original exception.
|
||||||
|
connection.needs_rollback = True
|
||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
# Commit transaction
|
# Commit transaction
|
||||||
|
@ -243,7 +249,7 @@ class Atomic(object):
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
connection.savepoint_rollback(sid)
|
connection.savepoint_rollback(sid)
|
||||||
except DatabaseError:
|
except Error:
|
||||||
# If rolling back to a savepoint fails, mark for
|
# If rolling back to a savepoint fails, mark for
|
||||||
# rollback at a higher level and avoid shadowing
|
# rollback at a higher level and avoid shadowing
|
||||||
# the original exception.
|
# the original exception.
|
||||||
|
|
Loading…
Reference in New Issue