Drop the ehcache dependency. Caching is a separate concern. #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I don't think Hibernate and Hibernate4 should depend on ehcache at all.
It seems to me that caching is a separate concern that should be addressed by a separate plugin (namely, the cache-ehcache plugin).
Setting up Hibernate caching with ehcache properly isn't as simple as how it's currently done in the Hibernate/Hibernate4, too:
cache.provider_class='net.sf.ehcache.hibernate.EhCacheProvider'
That isn't right because with that setup, there's a separate ehcache instance set up just for Hibernate, and it is only configurable using the default class path ehcache.xml (which falls back to ehcache-failsafe.xml). It doesn't get shutdown safely either (whereas the cache-ehcache plugin does safely shut it down) which causes problems when running distributed, or with a disk backing store.
I think the correct way to configure Hibernate with ehcache is as documented in the cache-ehcache plugin at https://grails-plugins.github.io/grails-cache-ehcache/guide/usage.html :
cache.region.factory_class = 'grails.plugin.cache.ehcache.hibernate.BeanEhcacheRegionFactory' // For Hibernate before 4.0
cache.region.factory_class = 'grails.plugin.cache.ehcache.hibernate.BeanEhcacheRegionFactory4' // For Hibernate before 4.0 and higher
You can see BeanEhcacheRegionFactory at https://github.com/grails-plugins/grails-cache-ehcache/blob/master/src/java/grails/plugin/cache/ehcache/hibernate/BeanEhcacheRegionFactory.java
In short, I propose the ehcache dependency be dropped from both plugins, and people use cache-ehcache if they want to use ehcache.