In the hibernate documentation (http://docs.jboss.org/hibernate/core/3.5/reference/en/html/performance.html
), it says:
20.2. The Second Level Cache
You have the option to tell Hibernate which caching implementation to use by specifying the name of a class that implements org.hibernate.cache.CacheProvider using the property hibernate.cache.provider_class. Hibernate is bundled with a number of built-in integrations with the open-source cache providers that are listed below. You can also implement your own and plug it in as outlined above. Note that versions prior to 3.2 use EhCache as the default cache provider.
What is the default behavior for v3.3+?
Does it still default to EhCache?
Does just listing a cache provider hibernate.cache.provider_class turn on the L2 cache and use that provider? or do I have to actually specify a <cache> mapping?
Do I have to turn it on with hibernate.cache.use_second_level_cache="true"?
Is there any other way to turn it on/off say programmatically?
How do these settings effect the loading of the classes for the L2 cache (ie. do EhCache classes automatically get class loaded since its the default? and when? Would other L2 cache impl classes get loaded the same way and time?)
It seems that one of my questions (Do I still need to turn it on with hibernate.cache.use_second_level_cache="true"?) was already answered in the v3.5 doc:
"hibernate.cache.use_second_level_cache Can be used to completely disable the second level cache, which is enabled by default for classes which specify a <cache> mapping." So it seems that L2 cache is enabled by default... to which impl though.
The 3.6 documentation's tutorial (ch1) has the following:
<!-- Disable the second-level cache -->
Would this be a way of not only disabling the L2 cache, but also preventing the loading of the default L2 cache by the class loader?