Code

Ticket #2304: 2304.diff

File 2304.diff, 850 bytes (added by thejaswi_puthraya, 6 years ago)

added the patch wrt r7277

Line 
1Index: django/db/transaction.py
2===================================================================
3--- django/db/transaction.py    (revision 7278)
4+++ django/db/transaction.py    (working copy)
5@@ -82,7 +82,15 @@
6     Sets a dirty flag for the current thread and code streak. This can be used
7     to decide in a managed block of code to decide whether there are open
8     changes waiting for commit.
9+
10+    DISABLE_TRANSACTION_MANAGEMENT puts the developer in control
11+    of the Unit of Work.  This will ignore the framework of the changes and allow
12+    the developer to make the determination of when to commit and rollback as well
13+    as assume the responsibility.
14     """
15+    if (settings.DISABLE_TRANSACTION_MANAGEMENT):
16+        return
17+
18     thread_ident = thread.get_ident()
19     if thread_ident in dirty:
20         dirty[thread_ident] = True