#13906: REPEATABLE READ (as used by default on MySQL) breaks atleast
QuerySet.get_or_create().
-------------------------------------+-------------------------------------
Reporter: sebastian_noack | Owner:
Type: | Status: new
Cleanup/optimization | Version: master
Component: Database layer | Resolution:
(models, ORM) | Triage Stage: Accepted
Severity: Normal | Needs documentation: 1
Keywords: mysql transaction | Patch needs improvement: 1
isolation | UI/UX: 0
Has patch: 1 |
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by aaugustin):
* status: assigned => new
* owner: aaugustin =>
Comment:
Since I recently re-implemented transaction management, I had a look at
this ticket. Unfortunately, even with the new features (savepoints), I
don't see an obvious solution.
When I was working on the transactions branch, I considered adding an
`ISOLATION_LEVEL` key in `DATABASES` entry. Database backends now contain
everything required to implement it. However, I decided against it,
because it would imply that Django works correctly under any isolation
level, and I don't think that's true. (There's a PostgreSQL-only option
for backwards compatibility, though.)
`get_or_create` is still usable in the general case. It's just vulnerable
to race conditions, despites containing code specifically to deal with
that race condition. I don't think it's worth documenting the caveat until
it's fixed.
--
Ticket URL: <https://code.djangoproject.com/ticket/13906#comment:38>
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].
For more options, visit https://groups.google.com/groups/opt_out.