Domanda

I tried to use a cache configuration like this post from a website:

<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>

<-- ... -->

It seems the schema file for my hibernate.cfg.xml is not liking this, though. Am I supposed to use cache.region_prefix or something? I want to use Syscache, btw.

È stato utile?

Soluzione

Neither the configSections nor the syscache sections go in your hibernate.cfg.xml file.

They go in the App.config/Web.config file.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top