I am using the Unit of Work template to process my session. Then I create an HttpModule that implements a “web request session” that works very well. My HttpModule will launch a block of work on the PreExecuteRequestHandler application, and then save it in the request. He then uses the PostExecuteRequestHandler hook to complete the Unit of Work.
This article of my Unit of Work is based on:
http://nhforge.org/wikis/patternsandpractices/nhibernate-and-the-unit-of-work-pattern.aspx
source
share