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

  • SEARCH
  • Home
  • 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 6127997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:34:36+00:00 2026-05-23T16:34:36+00:00

I am considering using Fluent NHibernate for a new application with SQL Server 2008

  • 0

I am considering using Fluent NHibernate for a new application with SQL Server 2008 and I am having trouble understanding the connection handling behavior I am seeing.

I am monitoring connections using sp_who2 and here is what I see:

  1. When the SessionFactory is created, a single connection is opened. This connection
    seems to stay open until the app is killed.

  2. No connection is opened when a new session is opened. (That’s ok, I understand NHibernate waits until the last moment to create database connections).

  3. No new connection is opened even when I run a query through NHibernate. I must assume it is using the connection created when the SessionFactory was created, which is still open. I set a breakpoint after the query (before the session was closed), and no new sessions had appeared in sp_who.

Running an entire app through a single connection is not acceptable (obviously). How can I ensure each ISession gets its own connection? I’m sure there’s something obvious I’m missing here…

Thanks in advance.

  • 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-23T16:34:36+00:00Added an answer on May 23, 2026 at 4:34 pm

    The behaviour that you see is nothing NHibernate specific – Connection pooling is default behaviour in SQL Server.
    Even if it may sound awkward at first glance, it actually is a good thing because creating new connections and maintaining them is expensive.
    (for more information, see the Wikipedia article about connection pooling)

    So there is no need to try to get NH to open a new connection for each session, because reusing existing connections actually improves SQL Server performance.

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

Sidebar

Related Questions

I am considering using Fluent NHibernate for my project and I haven't found any
I'm considering using NHibernate as a ORM layer for my application. However, Entity Framework
I am considering using Postsharp framework to ease the burden of application method logging.
My organization is considering using Jabber as an agnostic device to device to application
I'm considering using Amazon's EC2 with a windows instance & SQL. I've seen some
I'm considering using reporting services 05 SP2 with share point integration on a new
I'm considering using LINQ-to-SQL for creating the DAL in my app. I normally create
I am considering using CodeIgniter as the framework for my next web-application. However, I
I'm considering using Powershell scripts for triggers on our Perforce server. Unfortunately, even on
I am considering using virtual inheritance in a real-time application. Does using virtual inheritance

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.