-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Support for Hibernate ORM 5.2 [SPR-14327] #18899
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
Comments
Juergen Hoeller commented This turns out to be a significant effort, with plenty of deprecations to deal with - including a relocated |
Oliver Drotbohm commented Any chance we can backport this to 4.2? With that in place and some tweaks that already got working in Spring Data, we could even get Spring Boot 1.3 projects to use Hibernate 5.2 successfully. |
Juergen Hoeller commented I'd rather recommend a version override to Spring Framework 4.3 next to the Hibernate 5.2 override. The latter has way more implications than the former, and I'm not really keen on dragging the follow-up issues into our 4.2.x line. |
Hantsy Bai commented In Hibernate 5.2 , It seemsSession(org.hibernate.Session) changed the getFlushMode() method return type to javax.persistence.FlushModeType. I got failure when I used Spring boot 1.3 and Hibernate 5.2.0.Final. Caused by: java.lang.NoSuchMethodError: org.hibernate.Session.getFlushMode()Lorg/hibernate/FlushMode; |
Oliver Drotbohm commented The commits for that ticket fix exactly that. Note, that the tweaks only made it into Spring 4.3, not 4.2 (which is the version Boot 1.3 is currently based on). Boot 1.3 with Hibernate 5 is going to be a tough call, also due to the many changes that were introduced in 5.0 and the necessary tweaks to the existing auto-configuration for JPA. So while there is a theoretical chance you get it to work by upgrading Spring Framework to 4.3 snapshots (as GA is not released yet) and disabling all JPA related auto configuration and configure it manually, we highly recommend to wait for the Spring Boot 1.4 RC coming next, which will be based on Spring Framework 4.3 GA and have all the necessary tweaks to the auto-configuration built in so that Hibernate 5 (in whatever minor version) should be a pleasant experience. |
Hantsy Bai commented I am trying to upgrade to Spring Boot 1.4 M3, and got another issues the spring-boot-starter-data-jpa depends on hibernate-entitymanager, which is moved to Hibernate 5.2 core. I have just noticed this issue. Most of the time, I used Hibernate as JPA provider by default. Why spring-boot-starter-data-jpa depends on hibernate directly, not Java EE JPA API spec? which means we can not use OpenJPA, EclipseLink for JPA provider? |
Oliver Drotbohm commented Hibernate 5.2 was released two days ago. The Boot milestone was released way before that. Plus, it's the Hibernate guys that decided to change the artifact structure in a minor release and thus render Hibernate 5.2 unusable with the currently released Spring Boot Data JPA starter. The starter is just a convenience mechanism to get JPA up and running with the most popular JPA provider. Read up on the starters in Boot's reference documentation. That said, nothing forces you to use the starter in the first place. You could either stick to it, exclude Hibernate and pull in the persistence provider of your choice manually (like shown here or just don't use the starter at all and manually declare all dependencies you want. Generally speaking, I think we're moving away from the purpose of the ticket, which was putting the necessary tweaks in Spring Framework in place to make sure it works with Hibernate 5.2. Everything that needs to be done in Spring Data JPA is tracked in DATAJPA-911, everything for Spring Boot is tracked in this ticket. For more general questions on how to use the starters, please use StackOverflow and the Spring Boot Gitter channel. |
Holger Stenzhorn commented I have just upgraded our application to Spring 4.3 GA and Hibernate 5.2 and it seems that both are not yet working 100% together. The following bean declaration works fine with Spring 4.3 GA and Hibernate 5.1:
...but using Spring 4.3 GA and Hibernate 5.2 it leads to the following exception:
|
Juergen Hoeller commented This looks like a conflict between old |
Holger Stenzhorn commented Please disregard my last comment: Things work as they should! The problem was that the old (obviously cached) Hibernate 5.1 JAR files were wrongly used instead of the Hibernate 5.2 JAR files. Sorry for the noise! :( |
Andrei Ivanov commented 5.2.1 is out, with |
Juergen Hoeller commented Upgrading the Spring Framework 4.3.1 build to it. However, we'll keep not declaring It's nice for a seamless upgrade in Boot, of course! Makes the story much smoother there. |
Andrei Ivanov commented Indeed, I see the pom of |
Ashok commented Will there be a migration path to hibernate 5.* in spring 4.3? |
Ashok commented Since Andrei Ivanov mentioned that |
Oliver Drotbohm commented What do you mean with migration path? 5.2 shipped without a
There's nothing in Spring Framework code that needs to be tweaked. |
Ashok commented Thanks for the clarification. Earlier, I did not fully grasp what Andrei meant by this statement. |
Ashok commented Now I get it. |
Juergen Hoeller opened SPR-14327 and commented
Hibernate ORM 5.2 got released just in time for Spring Framework 4.3. Let's do everything we can to support it right away, in particular upgrading our
spring-orm-hibernate5
build to 5.2 while retaining compatbility with 5.0 and 5.1.Issue Links:
0 votes, 11 watchers
The text was updated successfully, but these errors were encountered: