Charlie Kelly 00 wrote:
The problem is caused by instantiating multiple instances of SessionFactory.
Better yet, you can actually configure for each of your session factories a different ehcache config file. I found this in the API doc, I also checked, and it works, you only need to specify different disk locations for each CacheManager.
class EhCacheProvider wrote:
When configuring multiple ehcache CacheManagers, as you would where you have multiple Hibernate Configurations and
multiple SessionFactories, specify in each Hibernate configuration the ehcache configuration using
the property <code>hibernate.cache.provider_configuration_file_resource_path</code> An example to set an ehcache configuration
called ehcache-2.xml would be <code>hibernate.cache.provider_configuration_file_resource_path=/ehcache-2.xml</code>. If the leading
slash is not there one will be added. The configuration file will be looked for in the root of the classpath.
Roland