Ticket #23074: 0001-Fixed-23074-Release-savepoints-after-doing-a-savepoi.patch

File 0001-Fixed-23074-Release-savepoints-after-doing-a-savepoi.patch, 1.5 KB (added by Chow Loong Jin <hyperair@…>, 10 years ago)

Patch to call savepoint_commit after savepoint_rollback in Atomic.exit

  • django/db/transaction.py

    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):  
    219219                        except DatabaseError:
    220220                            try:
    221221                                connection.savepoint_rollback(sid)
     222                                # Call savepoint_commit to avoid leaking sid
     223                                connection.savepoint_commit(sid)
    222224                            except Error:
    223225                                # If rolling back to a savepoint fails, mark for
    224226                                # rollback at a higher level and avoid shadowing
    class Atomic(object):  
    249251                    else:
    250252                        try:
    251253                            connection.savepoint_rollback(sid)
     254                            # Call savepoint_commit to avoid leaking sid
     255                            connection.savepoint_commit(sid)
    252256                        except Error:
    253257                            # If rolling back to a savepoint fails, mark for
    254258                            # rollback at a higher level and avoid shadowing
Back to Top