Django objects.create() causing duplicate primary keys

ساخت وبلاگ

Vote count: 0

I'm running load tests with JMeter on a Django project with a Postgres database. This has managed to cause duplicate primary key errors when creating M2M objects;

IntegrityError: duplicate key value violates unique constraint "entry_entrycharityenquiry_pkey"
DETAIL: Key (id)=(108) already exists.

This is happening when trying to create the relationship to objects after a user has selected from a list;

for ec in to_add: EntryCharityEnquiry.objects.create(**kwargs)

I can't see a problem with creating objects in a loop, so where/what could the error come from?

asked 8 secs ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 333 تاريخ : چهارشنبه 5 آبان 1395 ساعت: 8:53