#2705: [patch] Add optional FOR UPDATE clause to QuerySets
-------------------------------------+-------------------------------------
Reporter: Hawkeye | Owner: brunobraga
Type: New | Status: assigned
feature | Component: Database layer
Milestone: | (models, ORM)
Version: SVN | Severity: Normal
Resolution: | Keywords:
Triage Stage: Accepted | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 |
-------------------------------------+-------------------------------------
Comment (by danfairs):
Replying to [comment:80 jacob]:
> One nit: `docs/ref/models/querysets.txt` claims:
>
...
> But `docs/ref/databases.txt` claims:
>
> MySQL does not support the ``NOWAIT`` option to the ``SELECT ... FOR
UPDATE``
> statement. However, you may call the ``select_for_update()`` method
of a
> queryset with ``nowait=True``. In that case, the argument will be
silently
> discarded and the generated query will block until the requested lock
can be
> acquired.
...
>
> These don't agree, and looking at the code it appears the first claim is
correct. So something needs to be updated there.
Ah, good spot. We changed the behaviour of using select_for_update on
backends which don't support NOWAIT from a silent failure to raising a
DatabaseError a while back. Looks like I failed to update the docs. I'll
amend the patch (together with Carl's comments).
>
> Otherwise looks RFC to me.
Great.
--
Ticket URL: <http://code.djangoproject.com/ticket/2705#comment:82>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.