WCF应用程序中的NHibernate会话管理 [英] NHibernate session management in WCF application

查看:59
本文介绍了WCF应用程序中的NHibernate会话管理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个WCF应用程序,并使用NHibernate作为持久层.那里有很多关于将NHibernate与ASP.NET应用程序一起使用的文档.但是,在WCF应用程序中管理NHibernate会话的最佳方法很少.

I am building a WCF application, using NHibernate for the persistence layer. A lot of documentation thats out there is about using NHibernate with ASP.NET applications. But very little on the best ways to manage NHibernate Sessions in a WCF application.

在阅读了WCF应用程序中的实例管理技术之后,我将使用按通话服务".与ASP.NET并行绘制,就像在Application_BeginRequest上打开NHibernate会话并在Application_EndRequest上关闭它们.比利·麦卡弗蒂(Billy McCafferty)的 S#arp体系结构很好地说明了这一点.但是我发现在WCF应用程序中使用类似的概念有些困难.

After reading up on Instance Management Techniques in WCF applications, I am going to use "per-call Services". Drawing parallel with ASP.NET, this is like opening NHibernate sessions on Application_BeginRequest and closing them on Application_EndRequest. Billy McCafferty's S#arp Architecture has a great example of doing this very elegantly. But I am finding it a little hard to use a similar concept in a WCF application.

任何代码示例或带有示例的博客指针将不胜感激.

Any code samples or pointers to blogs with examples, will be greatly appreciated.

推荐答案

http://www.igloocoder.com/archive/2009/04/23/wcf-and-nhibernate-redux.aspx -> ://igloocoder.net:8443/svn/IglooCommons/trunk/src/IglooCoder.Commons/WcfNhibernate /

这篇关于WCF应用程序中的NHibernate会话管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆