When a transaction is running and an error occurs, ON CONFLICT clause not running default. For example when a transaction with 100 rows (inserts) is executed and row 50 raise a contraint exception, all rows above will not be executed.

SQLITE doku writes that "but changes caused by prior SQL statements within the same transaction are preserved and the transaction remains active".

This issue seems to involve the .NET Entity Framework and I am not an expert on that package; however, it seems that the TransactionScope class is normally unnecessary unless you have changes that span multiple object contexts (e.g. multiple SQLite databases), see:


Related:


Also, there seems to be a problem with the SQLiteConnection.EnlistTransaction method that prevents TransactionScope from working with an ObjectContext if the code involved tries to access the database more than once from inside the same transaction.

An experimental fix for this issue is available in check-in [f4e1038098], with unit tests.

Would it be possible for you to test this fix in your environment and report back with the outcome of your testing?