开发者

NHibernate session management with RIA-services

开发者 https://www.devze.com 2022-12-31 09:35 出处:网络
How should I manage my session? I\'ve seen some examples where the session is created in the constructor of the domainservice and destroyed in the dispose method, but this seems like a bad idea.

How should I manage my session? I've seen some examples where the session is created in the constructor of the domainservice and destroyed in the dispose method, but this seems like a bad idea.

Would appreciate help here because I can't find any information.开发者_如何学Go


I don't know RIA Services very well but it's based on WCF so maybe you can use the pattern of one session for each Operation, like in web you can use the pattern Session per Request ?

http://www.google.ca/search?hl=en&safe=off&q=WCF+Nhibernate+operation+context&aq=f&aqi=&aql=&oq=&gs_rfai=

and the first response give some code : http://realfiction.net/go/133

The next version of NHibernate, the integration of WCF should be built-in, here'sthe source code from the trunk : https://nhibernate.svn.sourceforge.net/svnroot/nhibernate/trunk/nhibernate/src/NHibernate/Context/WcfOperationSessionContext.cs

0

精彩评论

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

关注公众号