首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在nhibernate中为syscache配置缓存区域?

如何在nhibernate中为syscache配置缓存区域?
EN

Stack Overflow用户
提问于 2010-07-10 00:53:27
回答 1查看 2.3K关注 0票数 3

我试着使用缓存配置,就像网站上的这篇文章一样:

代码语言:javascript
复制
<configSections>
    <section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" requirePermission="false"/>
    <section name="syscache" type="NHibernate.Caches.SysCache.SysCacheSectionHandler, NHibernate.Caches.SysCache" requirePermission="false" />
</configSections>

<!-- NHibernate -->
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
    <session-factory>
        <!-- dialect, connection string, etc... -->

        <property name="cache.provider_class">NHibernate.Caches.SysCache.SysCacheProvider, NHibernate.Caches.SysCache</property>
        <property name="cache.use_second_level_cache">true</property>
    </session-factory>
</hibernate-configuration>

<!-- Caching -->
<syscache>
    <cache region="LongTerm" expiration="3600" priority="5" />
    <cache region="ShortTerm" expiration="900" priority="3" />
</syscache>

<-- ... -->

但是,我的hibernate.cfg.xml的模式文件似乎不喜欢这样。我是不是应该用cache.region_prefix或者别的什么?顺便说一下,我想使用Syscache。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-07-10 01:15:50

hibernate.cfg.xml文件中既不包含configSections部分,也不包含syscache部分。

它们位于App.config/Web.config文件中。

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3214825

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档