Friday 15 January 2010

Entity Framework 5 - "Conflicting Changes Detected" -


In our EF5 application, when we receive a SQL Server deadlock error on an insert or update, we immediately Let's try . However, when we try to do this, we get the following error:

  "Disputed changes were detected. This can happen only when the multiple keys are included with the same key Try it. "   

This error is not coming from SQL Server. This is an EF 5 error and we are not trying to insert several entities with the same key IOW, we have a duplicate line However, I suspect that this error means something else but I do not fully know what the problem is. If I had to guess, then I would say that in the first attempt, EF sees that while trying to incorporate an entity, it fails due to a deadlock when we try again immediately, EF thinks that we are the same Trying to do the same operation again with the key, and do not like it. Not sure how you can work on it.

It seems that you have the same example of DbContext in that case, Are pending.

Since no pending changes have been made ???? On the context, you should settle the references between references and rebuild.

No comments:

Post a Comment