From 4916d973440829396327496b284b9997519f4f6a Mon Sep 17 00:00:00 2001
From: Chow Loong Jin <hyperair@debian.org>
Date: Tue, 22 Jul 2014 15:53:59 +0800
Subject: [PATCH] Fixed #23074: Release savepoints after doing a savepoint
rollback in an atomic block
Signed-off-by: Chow Loong Jin <hyperair@debian.org>
---
django/db/transaction.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/django/db/transaction.py b/django/db/transaction.py
index 786bc53..cd4f4ef 100644
a
|
b
|
class Atomic(object):
|
219 | 219 | except DatabaseError: |
220 | 220 | try: |
221 | 221 | connection.savepoint_rollback(sid) |
| 222 | # Call savepoint_commit to avoid leaking sid |
| 223 | connection.savepoint_commit(sid) |
222 | 224 | except Error: |
223 | 225 | # If rolling back to a savepoint fails, mark for |
224 | 226 | # rollback at a higher level and avoid shadowing |
… |
… |
class Atomic(object):
|
249 | 251 | else: |
250 | 252 | try: |
251 | 253 | connection.savepoint_rollback(sid) |
| 254 | # Call savepoint_commit to avoid leaking sid |
| 255 | connection.savepoint_commit(sid) |
252 | 256 | except Error: |
253 | 257 | # If rolling back to a savepoint fails, mark for |
254 | 258 | # rollback at a higher level and avoid shadowing |