开发者

Storing Nhibernate ISession in Remote object contexts

开发者 https://www.devze.com 2022-12-08 01:24 出处:网络
Im currently building a remote object service that will expose a Server Activated object (per call, not singleton) that uses NHibernate. What i would like to know is there a way to ti开发者_开发问答e

Im currently building a remote object service that will expose a Server Activated object (per call, not singleton) that uses NHibernate. What i would like to know is there a way to ti开发者_开发问答e a Nhibernate Isession to a .net Remote equivalent to the HttpSession.Context- an ISession per call of my remote object.

I have a feeling that a per thread ISession should work (every call for my remote object will be serviced by a different thread, correct?) but if anyone can shed any light on this, i would greatly appreciate it.


Remoting has a concept of thread local storage via the CallContext. You can access it via CallContext.SetData() and CallContext.GetData(). You will need to manage your ISession carefully so that you don't leave it open...

0

精彩评论

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