문제

According to the answer on this post it states:

Did you know that ReadUncommitted will revert to Serialized isolation unless you've enabled the shared cache and both connections are from the same thread?

Working in C#, I then went ahead and defined a DLL import as follows:

[DllImport("System.Data.SQLite.dll", CallingConvention=CallingConvention.Cdecl)]
public static extern int sqlite3_enable_shared_cache(int enable);

I called this function to enable the cache and got a successful result status of 0 when called. Nonetheless, I still get the exception "isolationlevel", when executing the below lines and attempting to set the isolation level to ReadUncommitted.

string connectionString = @"data source=d:\db\test.db3;datetimeformat=Ticks";
SQLiteConnection conn = new SQLiteConnection(connectionString);
conn.Open();
IDbTransaction tran = conn.BeginTransaction(IsolationLevel.ReadUncommitted);

This question is related to another question I posted here.

How can I pull off a query with an isolation level of ReadUncommitted in SQLite?

도움이 되었습니까?

해결책

To accomplish uncommitted reads see the following question and answer:

How perform SQLite query with a data reader without locking database?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top