使用 RIA 服务进行 NHibernate 会话管理

发布于 2024-09-02 16:18:28 字数 103 浏览 1 评论 0原文

我应该如何管理我的会话?我见过一些示例,其中会话是在域服务的构造函数中创建并在 dispose 方法中销毁的,但这似乎是一个坏主意。

非常感谢这里的帮助,因为我找不到任何信息。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

审判长 2024-09-09 16:18:28

我不太了解 RIA 服务,但它基于 WCF,所以也许您可以为每个操作使用一个会话的模式,就像在网络中您可以使用每个请求一个会话的模式?

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

第一个响应给出了一些代码:
http://realfiction.net/go/133

NHibernate的下一个版本,WCF的集成应该是内置的,这是来自 trunk 的源代码:
https://nhibernate.svn。 sourceforge.net/svnroot/nhibernate/trunk/nhibernate/src/NHibernate/Context/WcfOperationSessionContext.cs

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文