Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3217482
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:24:58+00:00 2026-05-17T15:24:58+00:00

This has been a problem that has existed on 3 projects for me. I

  • 0

This has been a problem that has existed on 3 projects for me.

I have tried the following:

<property name="connection.isolation">ReadCommitted</property>

Set in hibernate.cfg.xml

Using fluent nhiberate:

MsSqlConfiguration.MsSql2008.IsolationLevel(IsolationLevel.ReadCommitted);

Set in global.asax.cs

I have always been forced to set it like so:

CurrentNhibernateSession.Transaction.Begin(IsolationLevel.ReadCommitted);

which works. (I can see this using NHibernate Profiler)

The problem is now I am using sharp architecture and transaction.begin is called inside that framework and I am having trouble rebuilding it.

Is there a way to do this that works without explicitly setting it when you begin a transaction?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T15:24:59+00:00Added an answer on May 17, 2026 at 3:24 pm

    Are you certain that this is the case? If you’re only verifying the isolation level by what NHProf is telling you; that could be a problem. Remember that NHProf is only reporting what the logging infrastructure in NHibernate feeds it. Perhaps the isolation level message isn’t sent when you open a transaction with the default? This could probably be verified by investigating the NHibernate source.

    I would suggest using an alternate means to verify the transaction level (perhaps SQL Profiler?) before concluding that this isn’t working as expected.

    Edit:

    I’ve had a look at the NHibernate source and can verify my hunch above. If you have a look at the AdoTransaction source you’ll note that it is logging an isolation level of IsolationLevel.Unspecified when a transaction is started without specifying a specific isolation level.

    // This is the default overload you're calling:
    public void Begin()
    {
    Begin(IsolationLevel.Unspecified);
    }
    
    // This is the full method impl
    public void Begin(IsolationLevel isolationLevel)
    {
    // snip....
    
    // This is the problematic line here; it will report an isolationLevel of Unspecified.
    log.Debug(string.Format("Begin ({0})", isolationLevel));
    
    // snip...
    
    }
    

    However, the actual transaction is being started with the isolation level specified in the config a few lines down as such:

    if (isolationLevel == IsolationLevel.Unspecified)
    {
    isolationLevel = session.Factory.Settings.IsolationLevel;
    }
    

    So, it would seem that NHProf is not being entirely accurate in this instance.

    Update:

    It appears this has been fixed in the trunk version of NHibernate, so I’m guessing this is no longer an issue with NHibernate 3.xx.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This has been a problem that I haven't been able to figure out for
This problem has been kicking my butt for a few days now. I have
This is a problem that has been eating at me for a while, and
This problem has been solved thanks to your suggestions. See the bottom for details.
I'm sure this problem has been solved before and I'm curious how its done.
I know this question has been asked before, but I ran into a problem.
A coworker has been struggling with this problem. The desired result is an installable
This has been driving me crazy for a few days. Why doesn't the following
This has been asked before (question no. 308581) , but that particular question and
This has been an adventure. I started with the looping duplicate query located in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.