Java Ehcache配置问题(密钥****的元素为空)
我对Ehcache配置有一个大问题 我使用:Java Ehcache配置问题(密钥****的元素为空),java,hibernate,ehcache,Java,Hibernate,Ehcache,我对Ehcache配置有一个大问题 我使用: ehcache 2.6.2 hibernate 3.3.1 GA 我当前的配置是: 1) 冬眠 <bean id="hibernateProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean"> <property name="properties"> <props> <
- ehcache 2.6.2
- hibernate 3.3.1 GA
<bean id="hibernateProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>
<prop key="hibernate.default_schema">@db.schema@</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="connection.pool_size">10</prop>
<prop key="hibernate.jdbc.batch_size">30</prop>
<prop key="hibernate.default_batch_fetch_size">30</prop>
<prop key="hibernate.max_fetch_depth">30</prop>
<prop key="hibernate.cache.use_second_level_cache">true</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.cache.region.factory_class">
net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory
</prop>
<prop key="net.sf.ehcache.configurationResourceName">
/ehcache-config.xml
</prop>
<prop key="hibernate.generate_statistics">true</prop>
</props>
</property>
</bean>
我注意到的最重要的一点是:所有使用缓存的尝试都以以下方式结束:
1) 19:30:47,396 DEBUG [EhcacheGeneralDataRegion] Element for key sql: **** is null
2) 20:26:31,939 DEBUG [EhcacheGeneralDataRegion] key: ****
20:26:31,939 DEBUG [EhcacheGeneralDataRegion] Element for key **** is null
谢谢你的帮助
向您致意。您能在每次命中对象时观察到
ehcache.getLiveCacheStatistics().getInMemoryHitCount()
吗?它变了吗?
19:30:51,829 DEBUG [Segment] fault added 0 on disk
19:30:51,829 DEBUG [Segment] put added 0 on heap
19:30:51,829 DEBUG [Segment] fault removed 0 from heap
19:30:51,829 DEBUG [Segment] fault added 0 on disk
19:30:51,829 DEBUG [Segment] put added 0 on heap
19:30:51,830 DEBUG [Segment] fault removed 0 from heap
19:30:51,830 DEBUG [Segment] fault added 0 on disk
1) 19:30:47,396 DEBUG [EhcacheGeneralDataRegion] Element for key sql: **** is null
2) 20:26:31,939 DEBUG [EhcacheGeneralDataRegion] key: ****
20:26:31,939 DEBUG [EhcacheGeneralDataRegion] Element for key **** is null