我试着使用缓存配置,就像网站上的这篇文章一样:
<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。
发布于 2010-07-10 01:15:50
hibernate.cfg.xml文件中既不包含configSections部分,也不包含syscache部分。
它们位于App.config/Web.config文件中。
https://stackoverflow.com/questions/3214825
复制相似问题