【发布时间】:2012-08-05 02:20:33
【问题描述】:
在 grails 1.3.9 应用程序中 ehcache 的默认值是什么?特别是我对查询缓存值感兴趣;我通过 postgres 的 psql 删除了几行,但我没有看到我的应用程序中反映的更改。我还没有将 ehcache.xml 文件添加到 conf 目录中。我什至重新启动了 grails 应用程序,数据仍然显示在报告中。有没有我可以删除的缓存文件作为解决方法?
更新:我添加了以下ehcache.xml配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd" >
<diskStore path="/tmp/ehcache_t2"/>
<cacheManagerEventListenerFactory class="" properties=""/>
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToLiveSeconds="120">
</defaultCache>
<cache name="org.hibernate.cache.UpdateTimestampsCache"
maxElementsInMemory="10000"
timeToIdleSeconds="300"
/>
<cache name="org.hibernate.cache.StandardQueryCache"
maxElementsInMemory="10000"
timeToIdleSeconds="30"
/>
</ehcache>
但 StandardQueryCache 的 timeToIdleSeconds="30" 也不起作用。
【问题讨论】:
-
Ehcache 用作直写缓存。如果你直接通过 psql 删除行,缓存是无法知道的。我希望缓存保持不变。
标签: hibernate grails ehcache default-value