ReadUncommitted broken in SQLite vs NHibernate

I use sqlite for test cases in a project that uses NHibernate. Everything works fine, except when I try to create a transaction with ReadUnCommitted:

eg. Session.BeginTransaction (System.Data.IsolationLevel.ReadUncommitted)

Error message:

"IsolationLevel"

(thats it)

The call stack is as follows:

at System.Data.SQLite.SQLiteConnection.BeginDbTransaction(IsolationLevel isolationLevel) at System.Data.Common.DbConnection.System.Data.IDbConnection.BeginTransaction(IsolationLevel isolationLevel) at NHibernate.Transaction.AdoTransaction.Begin(IsolationLevel isolationLevel) 

If I switch to a different isolation level (e.g. serialized or readcommitted), everything is done correctly.

Ideas?

 NHibernate 2.1.2 SQLite (.NET version) 1.0.65.0 Fluent NHibernate 1.0 
+4
source share
2 answers

Did you know that ReadUncommitted will revert to Serialized isolation if you haven't enabled shared cache and both connections are from the same thread? Perhaps someone is trying to save you from yourself?

+7
source

SQLite (or at least its ADO.NET provider) only supports Serializable and ReadCommitted isolation levels (and, of course, Unspecified, Serializable by default).

Any other value raises the Exception argument you specify.

+6
source

Source: https://habr.com/ru/post/1301615/


All Articles