#13906: REPEATABLE READ (as used by default on MySQL) breaks atleast
QuerySet.get_or_create().
---------------------------------------------------+------------------------
          Reporter:  sebastian_noack               |         Owner:  nobody
            Status:  new                           |     Milestone:        
         Component:  Database layer (models, ORM)  |       Version:  1.2   
        Resolution:                                |      Keywords:        
             Stage:  Unreviewed                    |     Has_patch:  0     
        Needs_docs:  0                             |   Needs_tests:  0     
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Changes (by akaariai):

  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 Setting transaction level to READ COMMITED does not solve your problem. A
 sequence showing erroneous behaviour in REPEATABLE READ:

 t1: SELECT * FROM foo WHERE condition # transaction 1 get part.[[BR]]
 t1: INSERT INTO ... # create[[BR]]
 t2: SELECT * FROM foo WHERE condition # transaction 2 get part, t2 sees
 nothing here.[[BR]]
 t1: commit()[[BR]]

 What would (at least partly) solve your problem is unique index on the
 where condition, then the DB would be able to block the t2's create.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/13906#comment:1>
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.

Reply via email to