I afraid, my code samples are a bit outdated for current version of NH.
I was trying to a) make session instance that could be easily used
across several unrelated parts of an application and b) make session
open and release connections for a short time, to play nicely with
connection pooling.
Now point "b" is already working as is. Point "a" became very doubtful
for me - looks like it's better to explicitly open a session and pass it
as argument to all necessary methods. Yes, it's a bit "not that
magical", but it removes magic-related bugs.
-- Andrew Mayorov |