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:31:13 +0200 |
| commit | 425c5e40eae90bd3ee3633011ef97edb26858c94 (patch) | |
| tree | 5791cbdf7cd9384ee650a497a9d677bbff105268 /docs/topics/db | |
| parent | 158b0a28374054b1c3f94a9602b69f93fc980448 (diff) | |
[1.8.x] 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).
Backport of 91e9f1c from master
Diffstat (limited to 'docs/topics/db')
| -rw-r--r-- | docs/topics/db/transactions.txt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/docs/topics/db/transactions.txt b/docs/topics/db/transactions.txt index 0e3c94f0c9..284cdb388f 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 |
