In Hibernate 3.0 final, I have noticed an issue trying to disable the second level cache. It seems I can't disable it and the dependency on ehcache without setting the Cache Provider to something (i.e. - HashtableCacheProvider).
In Configuration.java, line 182, from Hibernate 3.0 release:
Code:
// Second-level / query cache:
settings.setCacheProvider( createCacheProvider(properties) );
boolean useSecondLevelCache = PropertiesHelper.getBoolean(Environment.USE_SECOND_LEVEL_CACHE, properties, true);
log.info( "Second-level cache: " + enabledDisabled(useSecondLevelCache) );
settings.setSecondLevelCacheEnabled(useSecondLevelCache);
There is an attempt to instantiate the Cache Provider [createCacheProvider()] before it is checked whether the cache is enabled or not. If no cache provider is set, it attempts to instantiate EhCacheProvider by default.
Thus, if you just set hibernate.cache.use_second_level_cache to false, without setting the cache provider, you get a class not found exception for one of the ehcache classes.
Is this how it is supposed to work? I would think you could flip the logic above to remove the dependency on ehcache.
I noticed mention of a org.hibernate.cache.EmptyCacheProvider class in the distribution hibernate.properties, but that it is not included in the distribution.