mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
[1.6.x] Increased robustness of 58161e4e. Refs #22291.
Backport of ee837b9a from master
This commit is contained in:
parent
1d3d2b9a24
commit
80f6cbbadb
@ -302,7 +302,13 @@ class Atomic(object):
|
|||||||
try:
|
try:
|
||||||
connection.savepoint_commit(sid)
|
connection.savepoint_commit(sid)
|
||||||
except DatabaseError:
|
except DatabaseError:
|
||||||
|
try:
|
||||||
connection.savepoint_rollback(sid)
|
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
|
||||||
@ -328,7 +334,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…
x
Reference in New Issue
Block a user