ReadUncommitted在SQLite中针对NHibernate打破了

pro*_*mer 4 sqlite nhibernate isolation-level

我在一个利用NHibernate的项目中使用sqlite进行测试用例.一切都很好,除非我尝试创建一个ReadUncommitted事务:

例如Session.BeginTransaction(System.Data.IsolationLevel.ReadUncommitted)

错误消息是:

"的IsolationLevel"

(而已)

调用堆栈如下所示:

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)
Run Code Online (Sandbox Code Playgroud)

如果我切换到不同的隔离级别(如序列化或readcommitted),一切都会正确执行.

想法?

NHibernate 2.1.2
SQLite (.NET version) 1.0.65.0
Fluent NHibernate 1.0
Run Code Online (Sandbox Code Playgroud)

Jam*_*s L 7

您是否知道ReadUncommitted将恢复为Serialized隔离,除非您启用了共享缓存并且两个连接都来自同一个线程?也许有人试图拯救你自己?


Mau*_*fer 6

SQLite(或至少其ADO.NET提供程序)仅支持Serializable和ReadCommitted隔离级别(当然还有Unspecified,默认为Serializable).

任何其他值都会抛出您提到的ArgumentException.