我有一个使用多线程的Windows服务应用程序.我在这个应用程序的数据访问层使用NHibernate.
您对此应用程序中的会话管理有何建议?我读到了UNHAddins,这是一个很好的解决方案吗?
我目前有这个Fluent NHibernate配置:
public class NHibernateConfig
{
public static Configuration Configure()
{
var cfg = Fluently.Configure()
.Database(Config.PersistenceConfiguration)
.Mappings(m =>
{
m.FluentMappings.AddFromAssemblyOf<SomeAssembly>();
m.FluentMappings.Conventions.AddFromAssemblyOf<EnumConvention>(); })
.ExposeConfiguration(x => x.SetProperty("current_session_context_class", "thread_static"))
.BuildConfiguration();
return cfg;
}
}
Run Code Online (Sandbox Code Playgroud)
我的问题是暴露的属性" current_session_context_class".我知道两个值:thread_static或web.我的一位同事指出了另一个价值,即电话.有关于此属性的值的任何已知文档吗?如果没有,对这些值有什么好的描述吗?我已经花了几个小时搜索谷歌一些解释没有有效的结果.