summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-03-02 13:47:46 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-03-11 14:48:53 +0100
commitf5156194945661d217523d6648dfb9b48707ec95 (patch)
tree0645efea9da4a6e2aff7c3537cb5d4bcf2fc3117 /docs
parent7aacde84f2b499d9c35741cbfccb621af6b48903 (diff)
Added an API to control database-level autocommit.
Diffstat (limited to 'docs')
-rw-r--r--docs/internals/deprecation.txt7
-rw-r--r--docs/topics/db/transactions.txt17
2 files changed, 21 insertions, 3 deletions
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt
index 296f908a5b..74fbb563f0 100644
--- a/docs/internals/deprecation.txt
+++ b/docs/internals/deprecation.txt
@@ -348,9 +348,10 @@ these changes.
* Remove the backward compatible shims introduced to rename the attributes
``ChangeList.root_query_set`` and ``ChangeList.query_set``.
-* The private API ``django.db.close_connection`` will be removed.
-
-* The private API ``django.transaction.managed`` will be removed.
+* The following private APIs will be removed:
+ - ``django.db.close_connection()``
+ - ``django.db.backends.creation.BaseDatabaseCreation.set_autocommit()``
+ - ``django.db.transaction.managed()``
2.0
---
diff --git a/docs/topics/db/transactions.txt b/docs/topics/db/transactions.txt
index 11755ff5c5..e145edf149 100644
--- a/docs/topics/db/transactions.txt
+++ b/docs/topics/db/transactions.txt
@@ -208,6 +208,23 @@ 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.
+.. _managing-autocommit:
+
+Managing autocommit
+===================
+
+.. versionadded:: 1.6
+
+Django provides a straightforward API to manage the autocommit state of each
+database connection, if you need to.
+
+.. function:: get_autocommit(using=None)
+
+.. function:: set_autocommit(using=None, autocommit=True)
+
+These functions take a ``using`` argument which should be the name of a
+database. If it isn't provided, Django uses the ``"default"`` database.
+
.. _deactivate-transaction-management:
How to globally deactivate transaction management