What are ehcache\'s default values in a grails 1.3.9 application ? In particular I\'m interested in the query cache value; I deleted a couple of rows via postgres\' psql and
Grails will look for a ehcache.xml in the conf directory. If not found, it will use the one in your classpath, take a look at the ehcache-core.jar. You'll see a file named ehcache-failsafe.xml where you'll find:
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
maxElementsOnDisk="10000000"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU"
/>
To make use of the query cache, you must have configured in your Datasource.groovy:
hibernate {
cache.use_second_level_cache=true
cache.use_query_cache=true
cache.provider_class='org.hibernate.cache.EhCacheProvider'
}
Although, like @GreyBeardedGeek pointed out, EhCache is a write-through cache. It will only cache objects that are manipulated via hibernate and its second level cache. If you write a sql query in your database, it will not cache objects in your cache.
To understand more deeply about it, take a look here and here.