NHibernate + WCF + Windows Service和WcfOperationSessionContext类 [英] NHibernate + WCF + Windows Service and WcfOperationSessionContext class
本文介绍了NHibernate + WCF + Windows Service和WcfOperationSessionContext类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
- 我有一个Windows服务应用程序 我在其中创建WCF服务.
- 其中一项服务是数据 服务:添加,删除, 通过读取,更新数据 WCF.
- WCF使用NHibernate进行数据处理
- I have a Windows Service Application in which i create WCF services in it.
- One of the services is data services: add, delete, read , updatte data via WCF.
- WCF use NHibernate for data manipulation
所以我的客人是:
-
是否有任何有关WCF的Hibernate会话管理建议(最佳实践)?
任何人都知道
WcfOperationSessionContext (休眠3.0)类?
WcfOperationSessionContext (hibernate 3.0) class?
how to use it with WCF?
具体来说:
假设我有名为 DataServices
class WCFDataService .....
{
void SaveMyEntity(MyEntity entity)
{
.....................?? // How to do? Best Way
// Should i take one session and use it all times
// Should i take session and dipsose when operation finished then get
//new session for new operations?
// If many clients call my WCF service function at the same time?
// what may go wrong?
// etc....
}
}
我需要一个 NHibernateServiceProvider 类
class NHibernateServiceProvider ....
{
// How to get Session ?? Best way
ISession GetCurrentSession(){.... }
DisposeSession(){ ....}
}
最良好的祝愿
PS:我在这里和其他网页上阅读过类似的条目.但是看不到具体"的答案.
PS: I have read similiar entries here and other web pages. But can not see "concrete" answers.
推荐答案
Here is a post describing, in detail, all the steps for registering and using the WcfOperationSessionContext. It also includes instructions for using it with the agatha-rrsl project.
这篇关于NHibernate + WCF + Windows Service和WcfOperationSessionContext类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文