Run a good project in the company, get the home face running reported the following error:
Another cachemanager with same name ' hibernate ' already exists in the same VM.
After google,http://blog.sina.com.cn/s/blog_6e0810c701014dmv.html
Http://stackoverflow.com/questions/18032771/hibernate-second-level-cache-junit
The conclusion is that it is necessary to configure Singletonehcacheregionfactory to replace ehcacheregionfactory
<prop key= "Hibernate.cache.region.factory_class" >org.hibernate.cache.ehcache.ehcacheregionfactory</ Prop>
Replaced by
<prop key= "Hibernate.cache.region.factory_class" >org.hibernate.cache.ehcache. singletonehcacheregionfactory </prop>
The result is really so, but the problem comes out, why in the company environment with Ehcacheregionfactory,ok, and change an environment must use singletonehcacheregionfactory?
What is the difference between them?
Http://stackoverflow.com/questions/6615790/singletonehcacheregionfactory-vs-ehcacheregionfactory
Daniel, who is proficient in ehcache, is welcome to make a detailed explanation in the comment area.
Hibenate Second-level Ehcache