开发者

NHibernate SessionFactory

开发者 https://www.devze.com 2023-01-26 03:02 出处:网络
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 ?

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

精彩评论

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