我正在迁移到 Nhibernate 2.0 GA,但在 memcached 提供程序中设置缓存过期时遇到了一些麻烦。
我在 NHibernate.Caches.MemCache 源中看到有一个过期属性和一个 300 秒的默认值。
缓存区域也有属性,但配置部分处理程序似乎没有映射它们。
是否有其他方式设置缓存过期时间不是特定于提供者的——
这是功能性网络配置部分(显然没有过期设置)。
<memcache>
<memcached host="127.0.0.1" port="11211"/>
<!-- or multiples -->
</memcache>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="show_sql">true</property>
<property name="connection.provider" >NHibernate.Connection.DriverConnectionProvider</property>
<property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property>
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<!-- <property name="hibernate.cache.provider_class" value="NHibernate.Caches.MemCache.MemCacheProvider,NHibernate.Caches.MemCache" /> -->
<property name="connection.connection_string">Data Source=stage2.ripple6.com;Initial Catalog=r6stage;User Id=sa;Password=mworld7650;Application Name=Hibernate;</property>
<property name="connection.isolation">ReadCommitted</property>
<property name="cache.use_second_level_cache">true</property>
<property name="cache.provider_class">NHibernate.Caches.MemCache.MemCacheProvider,NHibernate.Caches.MemCache</property>
<property name="default_schema" >r6stage.dbo</property>
</session-factory>
</hibernate-configuration>