This is an automated email from the ASF dual-hosted git repository.

jamesfredley pushed a commit to branch factory-class-documentation
in repository https://gitbox.apache.org/repos/asf/grails-core.git

commit 351f265037acf315a63ee4a35bfb975d0215cc67
Author: James Fredley <[email protected]>
AuthorDate: Tue Sep 9 15:09:40 2025 -0400

    Add upgrade notes for hibernate.cache.region.factory_class
    
    Documents the deprecation and removal of 
org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory in Hibernate 6.0, its 
incompatibility with hibernate-jakarta 5.6.x, and provides guidance for 
updating configuration and dependencies when upgrading to Grails 7.
---
 .../src/en/guide/upgrading/upgrading60x.adoc       | 37 ++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/grails-doc/src/en/guide/upgrading/upgrading60x.adoc 
b/grails-doc/src/en/guide/upgrading/upgrading60x.adoc
index 6a229cbfa5..4805b447ec 100644
--- a/grails-doc/src/en/guide/upgrading/upgrading60x.adoc
+++ b/grails-doc/src/en/guide/upgrading/upgrading60x.adoc
@@ -434,3 +434,40 @@ To learn more about development reloading options, please 
see the link:gettingSt
 ===== 12.18 grails-i18n plugin
 
 `org.apache.grails:grails-i18n` has been changed to 
`org.apache.grails.i18n:grails-i18n` and is provided transitively, remove 
`org.apache.grails:grails-i18n` and `org.grails:grails-plugin-i18n` from your 
dependency list
+
+===== 12.19 hibernate.cache.region.factory_class
+
+`org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory` is deprecated in 
Hibernate 5.6 and removed in Hibernate 6.0. Additionally, it is not compatible 
with hibernate-jakarta 5.6.x, which is used by Grails 7.
+
+```console
+    hibernate:
+        allow_update_outside_transaction: true
+    cache:
+        queries: false
+        use_second_level_cache: true
+        use_query_cache: false
+        region:
+        factory_class: 
'org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory'
+```
+
+If your application sets `hibernate.cache.region.factory_class` to 
`org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory` it will add the 
`non-jakarta` version of `hibernate-core` to your classpath which will cause 
`NoClassDefFoundError` and `ClassNotFoundException` errors.
+
+You will need to change it to `jcache` and add the Ehcache dependency as 
follows:
+
+```console
+    hibernate:
+        allow_update_outside_transaction: true
+    cache:
+        queries: false
+        use_second_level_cache: true
+        use_query_cache: false
+        region:
+        factory_class: 'jcache'
+```
+
+```console
+    implementation 'org.ehcache:ehcache'
+```
+
+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]
+

Reply via email to