nhibernate - 如何在 Fluent NHibernate 中设置默认事务隔离级别?

标签 nhibernate fluent-nhibernate

我想在我的 Fluent NHibernate 配置中将默认事务级别设置为 ReadCommitted。如果我使用 XML 映射文件,我可以在我的配置文件中添加一个键:

<add key="hibernate.connection.isolation" value="ReadCommitted" />

但我不知道如何使用 Fluent 配置来实现这一点。

最佳答案

Fluent NHibernate doesn't do anything with the transaction isolation, so the default will be whatever NHibernate defaults to. I don't know off the top of my head what that is.

We don't have an explicit method to set the isolation, but as it's just a configuration value you can use the Raw method to set the property.


MsSqlConfiguration.MsSql2008.Raw("connection.isolation", "isolation_level");

来源:https://web.archive.org/web/20100812054505/http://support.fluentnhibernate.org/discussions/help/45-default-isolation-level-for-transactions

关于nhibernate - 如何在 Fluent NHibernate 中设置默认事务隔离级别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2668803/

相关文章:

asp.net-mvc-3 - NHibernate.ObjectNotFoundException : No row with the given identifier exists

nhibernate - Fluent NHibernate - 如何将外键列映射为属性

asp.net - 使用 Nhibernate 在子查询中仅选择不带 group by 属性的 max 子句

fluent-nhibernate - 在流畅的nhibernate中设置复合键属性的类型和长度

C# NHibernate - 在删除时删除对对象的所有引用

c# - 将(流利的)NHibernate 与 StructureMap(或任何 IoCC)一起使用

c# - NHibernate - 延迟加载问题 - 初始化 [] - 无法初始化代理 - 无 session 。”}

nhibernate - CaSTLe 项目 Active Record 或 Fluent NHibernate

NHibernate.QueryException : could not resolve property

nhibernate - 你如何在 NHibernate 中做两个表的联合?