Ticket #10744: cleanup-transaction-state-on-exit.diff

File cleanup-transaction-state-on-exit.diff, 698 bytes (added by Glenn Maynard, 15 years ago)
  • django/db/transaction.py

     
    7575    if dirty.get(thread_ident, False):
    7676        rollback()
    7777        raise TransactionManagementError("Transaction managed block ended with pending COMMIT/ROLLBACK")
    78     dirty[thread_ident] = False
     78    if thread_ident in state and len(state[thread_ident]) == 0:
     79        del state[thread_ident]
     80        if thread_ident in dirty:
     81            del dirty[thread_ident]
     82        if thread_ident in savepoint_state:
     83            del savepoint_state[thread_ident]
    7984
    8085def is_dirty():
    8186    """
Back to Top