Skip to content

Commit 8fd8d0c

Browse files
authored
Merge pull request #15203 from jdaugherty/bug_fix_ehcache
update documentation to suggest jakarta version of ehcache
2 parents be995b5 + 8cfeebe commit 8fd8d0c

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

grails-data-hibernate5/docs/src/docs/asciidoc/advancedGORMFeatures/ormdsl/caching.adoc

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,21 @@ https://www.hibernate.org/[Hibernate] features a second-level cache with a custo
2727
hibernate:
2828
cache:
2929
use_second_level_cache: true
30-
provider_class: net.sf.ehcache.hibernate.EhCacheProvider
3130
region:
32-
factory_class: org.hibernate.cache.ehcache.EhCacheRegionFactory
31+
factory_class: 'jcache'
32+
----
33+
34+
and the `ehcache` dependency using the `jakarta` classifier needs added to build.gradle:
35+
36+
[source,groovy]
37+
----
38+
dependencies {
39+
implementation 'org.ehcache:ehcache', {
40+
capabilities {
41+
requireCapability('org.ehcache:ehcache-jakarta')
42+
}
43+
}
44+
}
3345
----
3446

3547
You can customize any of these settings, for example to use a distributed caching mechanism.

grails-doc/src/en/guide/upgrading/upgrading60x.adoc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,13 +480,17 @@ You will need to change it to `jcache` and add the Ehcache dependency as follows
480480
use_second_level_cache: true
481481
use_query_cache: false
482482
region:
483-
factory_class: 'jcache'
483+
factory_class: 'jcache'
484484
----
485485

486486
[source,groovy]
487487
.build.gradle
488488
----
489-
implementation 'org.ehcache:ehcache'
489+
implementation 'org.ehcache:ehcache', {
490+
capabilities {
491+
requireCapability('org.ehcache:ehcache-jakarta')
492+
}
493+
}
490494
----
491495

492496
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]

0 commit comments

Comments
 (0)