- Where Developers Learn, Share, & Build Careers
I can not detect any patterns, perhaps in every 1,000 edits of a specific model, at 1 one M2M field Gives an Integrity Arrayer Most of the time this area was not modified too. When a model is saved, I believe that the DJgo always wipes the M2M field and then adds the item again, right? I looked at the My code then fails: Integrity: Duplicate key value violates unique obstacle "app_model_m2m_field_key" extension: key (model 1_id, model2_id) = (597) , 1009) already exists. It seems that the items are added before adding items, which is very strange. I have tried to reproduce it but it is very difficult, only sometimes it happens, by any idea what can this be? Maybe you can set yourself to solve this problem? Thank you in advance Most likely, you have two requests Request 2 starts a transaction and removes M2M lines with the same block where the blocks for the transaction of 1 request Waiting. Request 1 reset all M2M lines and commits. Request 2 resumes, and is deleted without deleting any rows, because all the rows that are in existence, when the statement is removed. Request 2 again INSERT is an M2M line, but the database detects that it already exists and returns an error. This upgrade (instead of reading the default of PostgreSQL) even more exciting potential failure modes and poor performance costs. I'm right that DEELET is performing after a series of Django INSERTs, although this will not be very good, the plan is fine because it increases such a race. The best plan is to identify what has really changed and ask the database to make those changes, because then if you get a integrity error then again it is a struggle that you Probably could not do anything anyway. clear () call to Dijena and then show the
plus () s item.
Comments
Post a Comment