配置多SessionFactory

来源:互联网 发布:欧美直播软件 编辑:程序博客网 时间:2024/06/06 19:51
SSH  配置多SessionFactory,报错
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.


 
解决方法是在Hibernate的hibernateProperties配置中,加上
<prop key="hibernate.cache.region.factory_class">
    net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory
</prop>
原创粉丝点击