summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-12-14 21:13:36 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-12-14 21:16:04 +0100
commit44e56238d79890176a747181d32fbc53be157706 (patch)
tree5addfd0a0d07096c1f0b186b4bb635babc7f8dd9
parentc20c3a20a313b24df6d115e585c04c8dc60d3970 (diff)
[1.5.x] Fixed #2304 -- Documented TRANSACTIONS_MANAGED.
Backport of a001f3c.
-rw-r--r--django/db/backends/__init__.py2
-rw-r--r--docs/ref/settings.txt10
-rw-r--r--docs/topics/db/transactions.txt4
3 files changed, 13 insertions, 3 deletions
diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py
index 8dd0212dbb..4390b1ec04 100644
--- a/django/db/backends/__init__.py
+++ b/django/db/backends/__init__.py
@@ -181,8 +181,6 @@ class BaseDatabaseWrapper(object):
"""
if self.transaction_state:
return self.transaction_state[-1]
- # Note that this setting isn't documented, and is only used here, and
- # in enter_transaction_management()
return settings.TRANSACTIONS_MANAGED
def managed(self, flag=True):
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
index 2177945d22..daa4ee9a46 100644
--- a/docs/ref/settings.txt
+++ b/docs/ref/settings.txt
@@ -2069,6 +2069,16 @@ to ensure your processes are running in the correct environment.
.. _pytz: http://pytz.sourceforge.net/
+.. setting:: TRANSACTIONS_MANAGED
+
+TRANSACTIONS_MANAGED
+--------------------
+
+Default: ``False``
+
+Set this to ``True`` if you want to :ref:`disable Django's transaction
+management <deactivate-transaction-management>` and implement your own.
+
.. setting:: USE_ETAGS
USE_ETAGS
diff --git a/docs/topics/db/transactions.txt b/docs/topics/db/transactions.txt
index 3c0ec4f187..65944abb8b 100644
--- a/docs/topics/db/transactions.txt
+++ b/docs/topics/db/transactions.txt
@@ -208,11 +208,13 @@ This applies to all database operations, not just write operations. Even
if your transaction only reads from the database, the transaction must
be committed or rolled back before you complete a request.
+.. _deactivate-transaction-management:
+
How to globally deactivate transaction management
=================================================
Control freaks can totally disable all transaction management by setting
-``DISABLE_TRANSACTION_MANAGEMENT`` to ``True`` in the Django settings file.
+:setting:`TRANSACTIONS_MANAGED` to ``True`` in the Django settings file.
If you do this, Django won't provide any automatic transaction management
whatsoever. Middleware will no longer implicitly commit transactions, and