【发布时间】:2011-04-26 17:24:37
【问题描述】:
使用这个,我可以告诉 Fluent NHibernate 使用 SysCache 作为 2nd Level Cache Provider:
MsSqlConfiguration.MsSql2008.ShowSql().ConnectionString(x =>
{
x.Server(@"localhost\ANDREPC");
x.Database("mydb");
x.TrustedConnection();
}).Cache(c => c.ProviderClass<SysCacheProvider>().UseQueryCache())
另外,SysCache的配置必须放在Web.Config上:
<configuration>
<configSections>
<section name="syscache" type="NHibernate.Caches.SysCache.SysCacheSectionHandler,NHibernate.Caches.SysCache" />
</configSections>
<syscache>
<cache region="foo" expiration="500" priority="4" />
<cache region="bar" expiration="300" priority="3" />
</syscache>
</configuration>
现在呢?这些区域是什么意思?如何将区域与类型关联?我如何使它工作?我的 jMeter 测试表明,在上面的配置之后,我的应用程序比以前慢了 7%。我需要了解 SysCache 并学习如何继续配置。
谢谢。
PS:官方的 SysCache 文档是here,它不是解释性的
【问题讨论】:
标签: c# .net nhibernate caching fluent-nhibernate