#9581: Race condition in Model.save() with non-automatic unique indexes
---------------------------------------------------+------------------------
Reporter: [EMAIL PROTECTED] | Owner: nobody
Status: closed | Milestone:
Component: Database layer (models, ORM) | Version: 1.0
Resolution: invalid | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------------+------------------------
Changes (by mtredinnick):
* status: reopened => closed
* resolution: => invalid
Comment:
There are lots of different ways Integrity errors can be raised from a
call to save(). If there's a chance that your table structure will hit one
of those (e.g. a uniqueness constraint on manually set data), then you
have to be prepared to handle the error. How it is handled is not
something Django can take care of for you, since the result will be
domain-specific. Therefore Django does the only correct thing: raises an
!IntegrityError.
The admin interface is the one place in Django that does have to handle
this stuff automatically, and that will be handled as part of the model-
aware validation changes (it's not directly part of that but handling
saving of forms there will be necessary and that will show one approach).
So there's no real bug with Django here. The database is the ultimate
serialisation point and failures can happen for certain types of data
modelling. You have the power to handle that in your code and should do
so.
--
Ticket URL: <http://code.djangoproject.com/ticket/9581#comment:3>
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
-~----------~----~----~----~------~----~------~--~---