Default Isolation Level for Transactions

Ralph Balck's Avatar

Ralph Balck

15 Mar, 2010 05:54 PM via web

Hi all,

I've read that setting the Default Schema and Default Isolation can
help greatly with performance. I found how to set the DefaultSchema
for a FluentConfiguration, but i cant find anything for isolation
level.

Is there a way to set the default Isolation Level for transactions
with fluent nhibernate? Or do i have to specify it manually every
time i begin a transaction?

Also, if i don't do anything, what isolation level is used?
Unspecified?

thanks!
Ralph

  1. Support Staff 2 Posted by James Gregory on 17 Mar, 2010 01:25 PM

    James Gregory's Avatar

    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");
    
  2. 3 Posted by Ralph Balck on 17 Mar, 2010 08:17 PM

    Ralph Balck's Avatar

    Right on, that works great. Thanks James!

  3. Support Staff 4 Posted by James Gregory on 18 Mar, 2010 09:02 AM

    James Gregory's Avatar

    No problem. I'll try to get a method in place to do this for the next release.

  4. James Gregory closed this discussion on 18 Mar, 2010 09:02 AM.

  5. Support Staff 5 Posted by James Gregory on 01 May, 2010 11:49 AM

    James Gregory's Avatar

    FYI, there's now a method for this in master.

Comments are currently closed for this discussion. You can start a new one.