Update concurrency.md#4972
Conversation
Add information about circumstances under which it is possible for a `DbUpdateConcurrencyException` to be thrown when adding entities.
|
While what you say is technically correct, the situations in which this happens are very, very edge-casey and users have to very intentionally and specifically configure their database in a special way to make this happen. So I'd rather simply add the word Does that make sense? |
|
I understand what you mean and it does make sense. I think we're both right - I can see your reasoning but still believe giving this information to users would be beneficial. In the end these are your docs, not mine, so if you want me to just add |
|
OK, thanks. At the end of the day, this is the first time anyone has raised this AFAIK, and I don't believe the the added sentences would actually help someone in advance in some concrete case. So yeah, I believe just adding |
Updating with @roji's recommendation.
Add information about circumstances under which it is possible for a
DbUpdateConcurrencyExceptionto be thrown when adding entities.In the edited document it is originally stated that a
DbUpdateConcurrencyExceptioncannot be thrown when adding new entities. However in an SQLite table with constraintUNIQUE("Column Name") ON CONFLICT IGNOREattempting to add a conflicting entity will cause SQLite to simply ignore it and, thus, return fewer rows affected than what EF Core would expect, causing it to raise the exception.The same is probably true for other RDBMS, for example: Microsoft SQL Server with
IGNORE_DUP_KEY = ONbut I have not tested it to confirm.