diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2015-09-21 20:53:10 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2015-09-21 22:21:53 +0200 |
| commit | 91e9f1c972842284a94097e252307ce6ed1007a1 (patch) | |
| tree | 02d46fd57f4443dad4bd0c8ef3f6dec023ad18f4 /docs | |
| parent | 361254810eb8920978d69aa0fc074dbd40bfcc21 (diff) | |
Fixed #24921 -- set_autocommit(False) + ORM queries.
This commits lifts the restriction that the outermost atomic block must
be declared with savepoint=False. This restriction was overly cautious.
The logic that makes it safe not to create savepoints for inner blocks
also applies to the outermost block when autocommit is disabled and a
transaction is already active.
This makes it possible to use the ORM after set_autocommit(False).
Previously it didn't work because ORM write operations are protected
with atomic(savepoint=False).
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/releases/1.8.5.txt | 4 | ||||
| -rw-r--r-- | docs/topics/db/transactions.txt | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/docs/releases/1.8.5.txt b/docs/releases/1.8.5.txt index 9cdd802057..d412c4b653 100644 --- a/docs/releases/1.8.5.txt +++ b/docs/releases/1.8.5.txt @@ -46,3 +46,7 @@ Bugfixes * Readded inline foreign keys to form instances when validating model formsets (:ticket:`25431`). + +* Allowed using ORM write methods after disabling autocommit with + :func:`set_autocommit(False) <django.db.transaction.set_autocommit>` + (:ticket:`24921`). diff --git a/docs/topics/db/transactions.txt b/docs/topics/db/transactions.txt index 5261f301a0..ad4e027ef5 100644 --- a/docs/topics/db/transactions.txt +++ b/docs/topics/db/transactions.txt @@ -200,8 +200,12 @@ Django provides a single API to control database transactions. the error handling described above. You may use ``atomic`` when autocommit is turned off. It will only use - savepoints, even for the outermost block, and it will raise an exception - if the outermost block is declared with ``savepoint=False``. + savepoints, even for the outermost block. + + .. versionchanged:: 1.8.5 + + Previously the outermost atomic block couldn't be declared with + ``savepoint=False`` when autocommit was turned off. .. admonition:: Performance considerations |
