mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Added an API to control database-level autocommit.
This commit is contained in:
parent
7aacde84f2
commit
f515619494
14 changed files with 81 additions and 13 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue