#16865: get_or_create defaults to _for_write even when it's just reading
-------------------------------------+-------------------------------------
               Reporter:  Rick van   |          Owner:  nobody
  Hattem <Rick.van.Hattem@…>         |         Status:  new
                   Type:  Bug        |      Component:  Database layer
              Milestone:             |  (models, ORM)
                Version:  1.3        |       Severity:  Normal
             Resolution:             |       Keywords:
           Triage Stage:  Accepted   |      Has patch:  0
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  1
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
Changes (by carljm):

 * needs_better_patch:   => 0
 * needs_docs:   => 0
 * needs_tests:   => 0
 * stage:  Unreviewed => Accepted


Comment:

 This seems reasonable; the downside is if you first read from the read
 slave it might increase the likelihood of collisions (the `IntegrityError`
 case further down) due to replication lag. Still seems like that might be
 an OK exchange for getting the majority of reads onto the read slave; it's
 a reasonable assumption that the common case for most uses of
 `get_or_create` is that the object already exists.

 Tentatively accepting, but I'd like to hear from Alex or Russell, who are
 more familiar with the multi-db stuff.

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