c# - Inactive sessions left open by NHibernate -
c# - Inactive sessions left open by NHibernate -
i using nhibernate connect oracle 11g database. database administrator has asked me have @ programme there lots of inactive sessions beingness left open, , apparently crash server.
why nhibernate not closing connections? here illustration of code:
public void foo() { using (_sessionfactory = _configuration.buildsessionfactory()) using (_session = _sessionfactory.opensession()) { _session.transaction.begin(); //do stuff _session.transcation.commit(); } }
i under impression disposing of session , sessionfactory, phone call session.close() , connection closed.
is connection pooling doing it's job? if there way in can set maximum size connection pool? idealy in fluent nhibernate?
looking @ code, seems code allows creation of multiple instances of session factories, best practice create 1 session factory.
and when using connection pooling, connection pool created each session mill , seems causes have inactive connections.
c# oracle nhibernate fluent-nhibernate
Comments
Post a Comment