ehcache2.5后hibernate多SessionFactory报错的解决
来源:互联网 发布:redis数据库设计java 编辑:程序博客网 时间:2024/06/11 03:12
今天在项目中配置多SessionFactory,抛错
org.hibernate.cache.SingletonEhCacheRegionFactory
Caused by: net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:
1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
2. Shutdown the earlier cacheManager before creating new one with same name.
经查,ehcache在2.5以后,CacheManager使用了Singleton,这样在创建多个CacheManager时就会产生上述错误。
http://ehcache.org/documentation/get-started/concepts 是官方解释
解决方法是在Hibernate的hibernateProperties配置中,加上
<prop key="hibernate.cache.region.factory_class">
</prop>
0 0
- ehcache2.5后hibernate多SessionFactory报错的解决
- ehcache2.5后hibernate多SessionFactory报错的解决
- ehcache2.5后hibernate多SessionFactory报错的解决
- ehcache2.5后hibernate多SessionFactory报错的解决
- ehcache2.5后hibernate多SessionFactory报错的解决(Another unnamed CacheManager )
- 关于Hibernate 5 和 Hibernate 4 在创建SessionFactory的不同点分析(解决 org.hibernate.MappingException: Unknown entit
- Hibernate的Transaction SessionFactory
- Hibernate 的 SessionFactory接口
- Hibernate的sessionFactory
- sessionFactory.getCurrentSession()报错
- Hibernate报错解决
- hibernate 的SessionFactory的实现
- Hibernate的sessionFactory的封装
- Hibernate 中 SessionFactory的创建
- hibernate中SessionFactory的创建
- Hibernate的SessionFactory、Session介绍
- Hibernate的核心接口:SessionFactory
- hibernate SessionFactory的获取方法
- LeetCode 148. Sort List
- jquery 删除动态创建的table中的tr
- 初识STL——set,multiset,map,multimap
- 写好自己的模板方法,以后要做的就是对于模板方法进行具体化了
- PHP入门
- ehcache2.5后hibernate多SessionFactory报错的解决
- Service
- Linux编程磁盘管理基本命令
- hdu3555 数位dp
- 《python+opencv实践》四、图像特征提取与描述——29理解图像特征
- MySQL在大型网站的应用架构演变
- uc/os-II 分析(8)---互斥型信号量
- 网页中添加多媒体元素
- 数据结构(三)——单链表的插入与删除