I would like to set the default transaction level to ReadCommitted in my Fluent NHibernate configuration. If I were using XML mapping files, I could add a key to my config file:
<add key="hibernate.connection.isolation" value="ReadCommitted" />
but I can't figure out how to accomplish this with Fluent configuration.
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");
Source: https://web.archive.org/web/20100812054505/http://support.fluentnhibernate.org/discussions/help/45-default-isolation-level-for-transactions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With