EHCache default values in a grails 1.3.9 application

前端 未结 1 1984
有刺的猬
有刺的猬 2021-01-16 05:45

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

1条回答
  •  孤独总比滥情好
    2021-01-16 06:33

    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:

     
    

    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.

    0 讨论(0)
提交回复
热议问题