summaryrefslogtreecommitdiff
path: root/docs/topics
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/topics
parent7aacde84f2b499d9c35741cbfccb621af6b48903 (diff)
Added an API to control database-level autocommit.
Diffstat (limited to 'docs/topics')
-rw-r--r--docs/topics/db/transactions.txt17
1 files changed, 17 insertions, 0 deletions
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