Metro - Transaction bug
Posted: Mon 04 Mar 2013 12:05
It is unable to execute transaction with LinqConnect for Metro.
Using following code:
This script fails on executing "ExecuteNonQuery()" method on second query. (First statement executes correctly.) The exception message is "Unable to open database file". Looking to the folder with deployed database there are two temporary files locking the database "etilqs_*".
I've tried set different types of TransactionMode (exclusive) or IsolationLevel (read uncommited) without success. Also changing Journal_Mode to something different (e.g. TRUNCATE) doesn't help.
Also running transaction only with INSERT statement works properly. The problem occurs only if changing data (UPDATE, DELETE, REPLACE) when journal file is created.
Using following code:
Code: Select all
SQLiteConnection conn = SQLiteConnection(ConnectionString)
conn.Open();
SQLiteTransaction trans = conn.BeginTransaction()
SQLiteCommand cmd = new SQLiteCommand("UPDATE t SET NAME='a' WHERE ID = 1"; conn);
cmd.CommandType = CommandType.Text;
cmd.Transaction = trans;
cmd.ExecuteNonQuery();
cmd = new SQLiteCommand("UPDATE t SET NAME='b' WHERE ID = 2"; conn);
cmd.CommandType = CommandType.Text;
cmd.Transaction = trans;
cmd.ExecuteNonQuery();
trans.Commit();
I've tried set different types of TransactionMode (exclusive) or IsolationLevel (read uncommited) without success. Also changing Journal_Mode to something different (e.g. TRUNCATE) doesn't help.
Also running transaction only with INSERT statement works properly. The problem occurs only if changing data (UPDATE, DELETE, REPLACE) when journal file is created.