Transaction on conflict behave
|User & Date:||mistachkin 2011-09-11 15:37:19|
- Change comment to:
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".
mistachkin added on 2011-09-11 13:09:52 UTC:
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:
mistachkin added on 2011-09-11 13:40:00 UTC:
mistachkin added on 2011-09-11 13:42:27 UTC:
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.
mistachkin added on 2011-09-11 15:36:54 UTC:
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?
- Change subsystem to "Connection"