there are lots of examples online about proper session management. there are 
2 issues I currently see.
1. the scope of session
2. missing transactions

you can manage session scope with the aid of CurrentSessionContext.
for a website open a session when the request begins, and dispose when the 
session ends.
for a fat client the common approach is a session per form.
for a service or message bus a common approach is a session per thread.

once the scope of session is corrected you can then add transactions. I like 
to manage the transactions at the controller presenter level using AOP. For 
a website managed by MVC this can be done with a Filter for the controller.

if you google CurrentSessionContext you will find many examples. web/mvc 
being the most common.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to