gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 16:38:45 25 4
gpt4 key购买 nike

我想在我的 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com