NHibernate Connection Pooling

前端 未结 1 781
南笙
南笙 2021-01-20 21:00

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.

相关标签:
1条回答
  • 2021-01-20 21:35

    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 讨论(0)
提交回复
热议问题