Hi Carsten,
On Thursday, October 22, 2015 at 9:56:36 AM UTC-4, Carsten Fuchs wrote:
-- Something that might help: depending on how your unique keys are set up, if the thread thinks that the object is new, it could try using .save(force_insert=True). That way it won't overwrite a different object with the same PK.
Thanks,
Collin
On Thursday, October 22, 2015 at 9:56:36 AM UTC-4, Carsten Fuchs wrote:
Am 22.10.2015 um 01:16 schrieb Simon Charette:
> I would suggest you use select_for_update()
> <https://docs.djangoproject.com/en/1.8/ref/models/ > in aquerysets/#select-for-update
> transaction.
This only covers the case where the object with the given ID already exists, doesn't it?
That is, if a new object is created in the except-clause, concurrent threads might
create a new object each, whereas it would presumably be expected that new_text is
(twice) added to a single common instance.
As I had the quasi exact same question a while ago (see
https://groups.google.com/forum/#!topic/django-users/ ) but never got a reply,SOX5Vjedy_s
I (too) am wondering how the new-object case in the except-clause could be handled?
Best regards,
Carsten
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/46fead13-f0b6-4321-b184-1bb51ed3a294%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment