Ayende Rahien wrote:
You open the session in the HttpModule, not a transaction.
The session will manage the lifetime of a connection for you, currently, it will close this as early as possible, so you don't need to worry about it.
A transaction should be opened when you want to do some modification to the database, in most cases.
I wanted to understand more as to how the session manages the lifetime of the connection. I searched the code and the only place I found the closeConnection (on the factory) being called is from the SessionImpl's Dispose and Disconnect method. And the Disconnect method is called from the Close method of SessionImpl.
Can you please provide a little more explanation as to how the session is releasing connection "eagerly"?
If it is not, does this mean that we have to call Disconnect() on the session manually?
Regards
Job Samuel.