#26804: update_or_create() updates all columns, which could cause a race
condition
-------------------------------------+-------------------------------------
Reporter: jensen-cochran | Owner: jensen-
| cochran
Type: Bug | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: update_or_create | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by cristianocca):
Would it make sense to avoid the same race condition on get_or_create ?
Although an added select_for_update on a single get query which might be
the use case on most of the cases (99% selects, 1% actually create), would
reduce the performance of those gets by quite a lot since a
select_for_update adds a lock/write to the row. So should probably be
documented or come with an optional flag.
--
Ticket URL: <https://code.djangoproject.com/ticket/26804#comment:10>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/072.94411fcc814a9b458b30cf74f1b89df7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.