How to set transaction isolation level in ReadUncommitted in SQLite?

According to the response to this post , it says:

Did you know that ReadUncommitted will revert to Serialized isolation if you don't enable a shared cache and both connections are connected to the same thread?

While working in C #, I then went ahead and defined the 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 turn on the cache and got a successful result status when calling 0. However, I still get an "isollevel" exception when executing the below lines and trying 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 that I posted here .

How can I execute a query with ReadUncommitted isolation level in SQLite?

+3
1
+2

All Articles