I just want to have this confirmed :
When working with NHibernate, I am expected to get a session from the session factory for each开发者_如何学运维 operation, right ?
Regards, MadSeb
What's your definition of 'operation' ? You can perform multiple actions within one session. You should see the session as a unit of work.
One session per transaction. For example one session per web-request in web-application.
A good practice is to put the SessionFactory stuff into Global.asax
See http://dotnetslackers.com/articles/aspnet/Configuring-NHibernate-with-ASP-NET.aspx for detailled informations
精彩评论