views:

43

answers:

2

Hi, is there a way to see all open nhibernate session in the application?

Why? Because, Ia m getting this error in my MVC application: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.

I have done this configuration: http://www.kevinwilliampang.com/2010/04/06/setting-up-asp-net-mvc-with-fluent-nhibernate-and-structuremap/

Please help.

+3  A: 

I would think the easiest way will be to hook up NHProf to your application. It will report back via it's UI all open sessions.

See the screenshots page for how the sessions will show up in this tool.

LordHits
but when the session closes (disposes) it remains in the NHProf. And I don't know which session is still open or closed.
Luka
I believe what you are seeing is just the session history list. You could look at the "session factory statistics" (below sessions tab in the UI) to check if you are calling the session factory correctly.
LordHits
Ok, the problem that I get is, How to know if all the session the application has opened, have been closed. Because the connection to the DB are not closed and are in sleeping mode.
Luka
A: 

You can see open sessionsin the session section of the nfprof. Closed sessions have duration displayed.

Luka