从我的 sql 日志文件中,我认为 QueryCache 的物理属性是由元素配置的:
<defaultCache
maxElementsInMemory="0"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="false"
memoryStoreEvictionPolicy="LRU"
/>
甚至我在ehcache.xml中添加了另一个元素,从 sql 日志看来,QueryCache 的物理属性仍然由元素。
<cache name="org.hibernate.cache.QueryCache"
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="false"
memoryStoreEvictionPolicy="LRU"
/>
我只想在内存中启用 QueryCache,同时默认禁用其他(在内存中)。也许是name属性元素不正确?我从书<>复制它。或者,我应该使用除 之外的其他元素吗?也许有一种元素?
谢谢。