-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude hibernate-ehcache #955
base: 9.0.x
Are you sure you want to change the base?
Conversation
Couple of thoughts about this:
I believe it is the responsibility of the consumer of @jamesfredley If you agree with these thoughts, would you like me to add them to this PR? |
This is true and it was removed around Sept of 2024, but then broke a number of tests in other Grails projects which depended upon it being provided by the hibernate5 plugin historically. So it is a trade off of a breaking change for Grails apps using ehcache during Grails 7 upgrade vs removing a dependency that is not directly used by the plugin. ehache does not exist for hibernate6, so when gorm-hibernate6 is ready, jcache will be part of the transition.
If we remove
A quick start to the list of locations that will need to have |
I’d prefer a breaking change in a major version update rather than continuing with the wrong approach. Why should every Grails app using
I looked through the issues related to this PR but couldn’t find a project demonstrating the need for It seems that |
@matrei Ok, please proceed with the changes.
That is excellent news, as I did not like adding that javax dependency. I'll be glad to work on updating the other Grails projects after this breaking change. |
Moved `hibernate-ehcache` to a runtime dependency where needed for tests, making it optional and reducing unnecessary module coupling. As a result, applications using `hibernate-ehcache` will now need to explicitly add it as a dependency.
Can we update the upgrade guide for Grails 7 to include these instructions since it is a breaking change? |
|
@@ -26,6 +26,7 @@ dependencies { | |||
runtimeOnly 'org.grails:grails-plugin-services' | |||
runtimeOnly 'org.grails:grails-plugin-url-mappings' | |||
runtimeOnly 'org.grails.plugins:fields' | |||
runtimeOnly "org.hibernate:hibernate-ehcache:$hibernateVersion" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the following to document the right approach and avoid conflicts from the javax version?
, {
exclude group:'org.hibernate', module:'hibernate-core'
}
|
||
testRuntimeOnly "org.hibernate:hibernate-ehcache:$hibernateVersion" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the following to document the right approach and avoid conflicts from the javax version?
, {
exclude group:'org.hibernate', module:'hibernate-core'
}
grails-plugin/build.gradle
Outdated
testRuntimeOnly "com.h2database:h2" | ||
testRuntimeOnly "org.apache.tomcat:tomcat-jdbc" | ||
testRuntimeOnly "org.hibernate:hibernate-ehcache:$hibernateVersion" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the following to document the right approach and avoid conflicts from the javax version?
, {
exclude group:'org.hibernate', module:'hibernate-core'
}
@matrei The documentation updates on grails/grails-doc#951 look great. What do you think about the 3 small changes I commented on the code? |
Even if it does not cause issues in this project, we explicitly exclude the `javax` variant of `hibernate-core` from `hibernate-ehcache` to document best practices and prevent potential conflicts in other setups.
@jamesfredley Well, that failed spectacularly😄 . I'll check what's needed to make it run again. |
@matrei It is the same error that I say initially. The following does resolve it, although I still think it is suboptimal since it includes 19 javax.transaction.* classes.
|
@jamesfredley Yes, you are right. The question is where we put the responsibility to add this. I would like to say on the application as we have already concluded |
@matrei I agree it is an application concern and am onboard with reducing the scope when we can. For this project we can add it as needed, for the 3 |
Excluding the `javax` variant from `hibernate-ehcache` requires explicitly including `jboss-transaction-api`.
- Revise the instructions for using GORM in a Spring Boot application. - Simplify the `application.yml` file in the Spring Boot test project.
@jamesfredley Excellent! Changes made, please review. |
I worry about this change. The gorm documentation (under Getting Started) recommends ehcache be included. Caching is a critical component of hibernate and we are definitely making this harder to include because of the extra gradle workarounds that are needed. We need to be sure to update the gorm docs for these workarounds so people understand this is only until we have hibernate 6. |
Yes, exactly! The documentation does not say that
Yes, it looks very outdated and needs to be updated. |
I will work on PRs for the following documentation updates: grails/grails-doc#953 |
I will also try to preemptively address the following, which will break with this change. |
resolves
hibernate-core
andhibernate-core-jakarta
being on the classpath#951