summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorShai Berger <shai@platonix.com>2014-03-30 20:03:35 +0300
committerShai Berger <shai@platonix.com>2014-04-10 03:04:51 +0300
commitf095356ba2244f6ed48463bac0b46d3c3e671204 (patch)
treedc0157b441d70e296e8948fd84ea953901f5fe44 /docs/ref
parent071c9337750b296d198cced56f3ffad0e176afb6 (diff)
Fixed #22343 -- Disallowed select_for_update in autocommit mode
The ticket was originally about two failing tests, which are fixed by putting their queries in transactions. Thanks Tim Graham for the report, Aymeric Augustin for the fix, and Simon Charette, Tim Graham & Loïc Bistuer for review.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/models/querysets.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
index fa3a45e1eb..18941773ba 100644
--- a/docs/ref/models/querysets.txt
+++ b/docs/ref/models/querysets.txt
@@ -1365,9 +1365,19 @@ do not support ``nowait``, such as MySQL, will cause a
:exc:`~django.db.DatabaseError` to be raised. This is in order to prevent code
unexpectedly blocking.
+Executing a queryset with ``select_for_update`` in autocommit mode is
+an error because the rows are then not locked. If allowed, this would
+facilitate data corruption, and could easily be caused by calling,
+outside of any transaction, code that expects to be run in one.
+
Using ``select_for_update`` on backends which do not support
``SELECT ... FOR UPDATE`` (such as SQLite) will have no effect.
+.. versionchanged:: 1.6.3
+
+ It is now an error to execute a query with ``select_for_update()`` in
+ autocommit mode. With earlier releases in the 1.6 series it was a no-op.
+
raw
~~~