mirror of
https://github.com/django/django.git
synced 2025-09-28 13:04:54 +00:00
Backport of ee837b9a
from master
This commit is contained in:
parent
2ad0bc132a
commit
1bcc8eb0f6
1 changed files with 8 additions and 2 deletions
|
@ -325,7 +325,13 @@ class Atomic(object):
|
|||
try:
|
||||
connection.savepoint_commit(sid)
|
||||
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
|
||||
else:
|
||||
# Commit transaction
|
||||
|
@ -351,7 +357,7 @@ class Atomic(object):
|
|||
else:
|
||||
try:
|
||||
connection.savepoint_rollback(sid)
|
||||
except DatabaseError:
|
||||
except Error:
|
||||
# If rolling back to a savepoint fails, mark for
|
||||
# rollback at a higher level and avoid shadowing
|
||||
# the original exception.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue