I'm using Hibernate 3.3.1 GA and Ehcache 1.5 and have noticed that the property that enables you to specify an ehcache configuration is ignored.
Code:
<property name="hibernate.cache.provider_class">net.sf.ehcache.hibernate.SingletonEhCacheProvider</property>
<property name="hibernate.cache.provider_configuration_file_resource_path">ehcache.xml</property>
If I specifiy another name for the file in the config above (say ehcache-2.xml), the ehcache config is still read from ehcache.xml.
Furthermore, if I rename my actual file ehcache.xml to something else (say ehcache-2.xml) and then set the configuration_file_resource_path to match the hibernate logs tell me that no configuration was found and it instead uses the ehcache failsafe settings.
Code:
2009-02-03 18:38:17,327 INFO [main] org.hibernate.impl.SessionFactoryImpl - building session factory - 2623
2009-02-03 18:38:17,347 WARN [main] net.sf.ehcache.config.ConfigurationFactory - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/Documents%20and%20Settings/Administrator/.m2/repository/net/sf/ehcache/ehcache/1.5.0/ehcache-1.5.0.jar!/ehcache-failsafe.xml - 2643
2009-02-03 18:38:17,417 WARN [main] net.sf.ehcache.hibernate.SingletonEhCacheProvider - Could not find a specific ehcache configuration for cache named [uk.co.mycompany.data.entities.Company]; using defaults. - 2713
This occurs with the net.sf.ehcache.hibernate.SingletonEhCacheProvider or with the org.hibernate.cache.EhCacheProvider class supplied in the hibernate-ehcache module.
It looks like the property hibernate.cache.provider_configuration_file_resource_path is ignored and ehcache tries to load its configuration from a file called ehcache.xml no matter what.
Has this property been renamed in hibernate 3.3? All the documentation and comments in the API docs for the org.hibernate.cache.EhCacheProvider classes state that this provider_configuration_file_resource_path property is the one to use to set an alternative ehcache configuration.
Many thanks in advance for any suggestions.[/code]