Issue Type: Task Task
Affects Versions: 4.1.9, 4.0.0.Final
Assignee: Unassigned
Components: caching (L2)
Created: 22/Jan/13 6:11 AM
Description:

I am trying to create multiple cachemanagers in the same JVM using EhCache 2.5.1. Hibernate's EhCacheRegionFactory ignores the cacheManagerName defined in properties, if there is a configurationResourceName defined.

I am using the following code.
configuration.setProperty("net.sf.ehcache.configurationResourceName", defFile);
configuration.setProperty("net.sf.ehcache.cacheManagerName", "ORM"+appName);

The EhCacheRegionFactory from EhCache 2.5.1 does this with
manager = new CacheManager(HibernateUtil.overwriteCacheManagerIfConfigured(configuration, properties));

But the EhCacheRegionFactory provided by Hibernate in 4.1.9 has this ->
Configuration configuration = HibernateUtil.loadAndCorrectConfiguration( url );
manager = new CacheManager( configuration );

Basically, it is missing the part where the configuration is updated based on properties defined.

This will result in an error since EhCache 2.5 does not support multiple cache managers with the same name.

Environment: Hibernate 4.1.9 EhCache 2.5.1
Project: Hibernate ORM
Labels: ehcache hibernate
Priority: Major Major
Reporter: Himavanth Rachamsetty
Original Estimate: 16h
Remaining Estimate: 16h
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira