开发者

NHibernate SessionFactory

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜