Hibernate共享CacheManager

在同时使用EhCache和EhCache-Web时会出现一个类似下面的警告:

Creating a new instance of CacheManager using the diskStorePath "C:\Use
rs\XXX" which is already used by an existing CacheManager.

修改Hibernate的配置文件可以解决这个问题:

<prop key="hibernate.cache.region.factory_class">net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory</prop>
 

相关推荐