On 16 heinä, 23:43, Ian Kelly <[email protected]> wrote:
> On Mon, Jul 16, 2012 at 2:18 PM, Cal Leeming [Simplicity Media Ltd]
>
> <[email protected]> wrote:
> > Okay - anyone else want to throw their thoughts at this?
>
> > Also - messing with the isolation levels on MySQL is really not a great
> > idea.. it can cause all sorts of unexpected behavior.
>
> Just a thought -- I don't have MySQL handy to test on, but what if the
> savepoint occurred before the first get instead of before the create?
> Would rolling back the savepoint then release the row lock and allow
> the second get to read the row?
>
> If this works but performance is an issue, then perhaps we could
> dynamically order the operations according to the known isolation
> level?

Unfortunately this doesn't work. There is another ticket where this
was discussed. At first it seems to work, but it turns out that it
works only if the get_or_create is called as the first thing in the
query. See https://code.djangoproject.com/ticket/13906#comment:29 and
https://code.djangoproject.com/ticket/13906#comment:30 for details.
Basically MySQL in repeatable read isolation works weird in this case.

 - Anssi

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" 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-developers?hl=en.

Reply via email to