On 23-6-2012 0:02, ydjango wrote: > > Thank you, I also believe it is Race condition. I do not want to use > get_or_create as I like to have control over DB writes and updates. I will > try Unique_together and catch the integrity error exception as Kurtis > suggested or check again before doing save(). > > or just thinking aloud, Is there a way to acquire a lock which can > serialize any other requests which have same "a" and "b" values?
unique_together + transaction middleware. https://docs.djangoproject.com/en/1.4/topics/db/transactions/ -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.