diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-03-23 20:45:22 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-03-23 20:45:22 +0100 |
| commit | 58161e4e93d1fc796fc804c943028d4433f4813c (patch) | |
| tree | bb45945369200e84f6008519a77bcf19723626b8 /django | |
| parent | a6fc18594ebf3e4268df701de5180c126ae2ca5e (diff) | |
Fixed #22291 -- Avoided shadowing deadlock exceptions on MySQL.
Thanks err for the report.
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/transaction.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/django/db/transaction.py b/django/db/transaction.py index e78ed9b421..c769a4ba89 100644 --- a/django/db/transaction.py +++ b/django/db/transaction.py @@ -231,7 +231,13 @@ class Atomic(object): if sid is None: connection.needs_rollback = True else: - connection.savepoint_rollback(sid) + try: + connection.savepoint_rollback(sid) + except DatabaseError: + # If rolling back to a savepoint fails, mark for + # rollback at a higher level and avoid shadowing + # the original exception. + connection.needs_rollback = True else: # Roll back transaction connection.rollback() |
