欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

grails中配置ehcache,grails配置ehcache,grails中配置ehc

来源: javaer 分享于  点击 32381 次 点评:106

grails中配置ehcache,grails配置ehcache,grails中配置ehc


grails中配置ehcache

groovy代码

在DataSource中配置hibernate二级缓存,采用ehcachedataSource{.......}//hibernate配置hibernate {    cache.use_second_level_cache = true    cache.use_query_cache = false    cache.provider_class = 'net.sf.ehcache.hibernate.EhCacheProvider'    show_sql=true    //current_session_context_class='thread'}在/conf/hibernate下建ehcache.xml,配置参考ehcache文档(ehcache.xml可选,不建的话,就启用默认配置)。//到这步配置完成了。配置spring的EhCacheManagerFactoryBean::在/conf/spring/resources.groovy中::beans{//缓存管理        cacheManager(org.springframework.cache.ehcache.EhCacheManagerFactoryBean){            configLocation = "classpath:ehcache.xml"        }}
相关栏目:

用户点评