Hibenate second-level ehcache
2015-11-03 10:35
411 查看
在公司运行好好的项目,拿到家里面运行 报了如下错误:
Another CacheManager with same name 'hibernate' already exists in the same VM。
经过Google,http://blog.sina.com.cn/s/blog_6e0810c701014dmv.html
http://stackoverflow.com/questions/18032771/hibernate-second-level-cache-junit
得出的结论是,需要配置 SingletonEhCacheRegionFactory 取代 EhCacheRegionFactory
<prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</prop>
替换为
<prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory </prop>
结果确实是好使了,但是问题就出来了,为什么在公司环境用EhCacheRegionFactory,OK,而换个环境必须用SingletonEhCacheRegionFactory 呢?
他们之间的区别是什么?
http://stackoverflow.com/questions/6615790/singletonehcacheregionfactory-vs-ehcacheregionfactory
有对Ehcache精通的大牛,欢迎在评论区做详细的解释。
Another CacheManager with same name 'hibernate' already exists in the same VM。
经过Google,http://blog.sina.com.cn/s/blog_6e0810c701014dmv.html
http://stackoverflow.com/questions/18032771/hibernate-second-level-cache-junit
得出的结论是,需要配置 SingletonEhCacheRegionFactory 取代 EhCacheRegionFactory
<prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</prop>
替换为
<prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory </prop>
结果确实是好使了,但是问题就出来了,为什么在公司环境用EhCacheRegionFactory,OK,而换个环境必须用SingletonEhCacheRegionFactory 呢?
他们之间的区别是什么?
http://stackoverflow.com/questions/6615790/singletonehcacheregionfactory-vs-ehcacheregionfactory
有对Ehcache精通的大牛,欢迎在评论区做详细的解释。
相关文章推荐
- Hibernate Oracle sequence的使用技巧
- jsp Hibernate批量更新和批量删除处理代码
- jsp hibernate的分页代码第1/3页
- JAVA+Hibernate 无限级分类
- SSH整合中 hibernate托管给Spring得到SessionFactory
- jsp hibernate 数据保存操作的原理
- hibernate中的增删改查实现代码
- 解决hibernate+mysql写入数据库乱码
- java优化hibernate性能的几点建议
- java Hibernate延迟加载
- hibernate 常用方法介绍
- JQuery+Ajax+Struts2+Hibernate框架整合实现完整的登录注册
- 深入理解Hibernate中的flush机制
- 简单的手工hibernate程序示例
- 解析使用jdbc,hibernate处理clob/blob字段的详解
- 浅析java程序中hibernate的应用总结
- java面试常见问题之Hibernate总结
- 关于Hibernate的一些学习心得总结
- Hibernate管理Session和批量操作分析
- 基于spring+hibernate+JQuery开发之电子相册(附源码下载)