diff --git a/grails-data-hibernate5/docs/src/docs/asciidoc/advancedGORMFeatures/ormdsl/caching.adoc b/grails-data-hibernate5/docs/src/docs/asciidoc/advancedGORMFeatures/ormdsl/caching.adoc index 3b47b6f68b1..31778ddd1d4 100644 --- a/grails-data-hibernate5/docs/src/docs/asciidoc/advancedGORMFeatures/ormdsl/caching.adoc +++ b/grails-data-hibernate5/docs/src/docs/asciidoc/advancedGORMFeatures/ormdsl/caching.adoc @@ -27,9 +27,21 @@ https://www.hibernate.org/[Hibernate] features a second-level cache with a custo hibernate: cache: use_second_level_cache: true - provider_class: net.sf.ehcache.hibernate.EhCacheProvider region: - factory_class: org.hibernate.cache.ehcache.EhCacheRegionFactory + factory_class: 'jcache' +---- + +and the `ehcache` dependency using the `jakarta` classifier needs added to build.gradle: + +[source,groovy] +---- + dependencies { + implementation 'org.ehcache:ehcache', { + capabilities { + requireCapability('org.ehcache:ehcache-jakarta') + } + } + } ---- You can customize any of these settings, for example to use a distributed caching mechanism. diff --git a/grails-doc/src/en/guide/upgrading/upgrading60x.adoc b/grails-doc/src/en/guide/upgrading/upgrading60x.adoc index 0133cd6bc60..0a84cc2b0b7 100644 --- a/grails-doc/src/en/guide/upgrading/upgrading60x.adoc +++ b/grails-doc/src/en/guide/upgrading/upgrading60x.adoc @@ -480,13 +480,17 @@ You will need to change it to `jcache` and add the Ehcache dependency as follows use_second_level_cache: true use_query_cache: false region: - factory_class: 'jcache' + factory_class: 'jcache' ---- [source,groovy] .build.gradle ---- - implementation 'org.ehcache:ehcache' + implementation 'org.ehcache:ehcache', { + capabilities { + requireCapability('org.ehcache:ehcache-jakarta') + } + } ---- Alternatively, you can define the hibernate-ehcache dependency explicitly and adjust it to exclude `hibernate-core` and add the `jboss-transaction-api_1.3_spec` see link:upgrading.html#_12_5_hibernate_ehcache[Hibernate-ehcache]