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
Align HibernateJpaVendorAdapter with Hibernate ORM 6.2 #30288
Comments
Same issue here for us.
When the org.springframework.orm.hibernate5.LocalSessionFactoryBean.afterPropertiesSet() method is called after the bean is initialized, a LocalSessionFactoryBuilder instance is used to setup the SessionFactory. Workaround: |
The problem can be seen even looking at the current As stated above, on Hibernate 6.0+ this override should return a |
The compatibility you're talking about is via the JPA persistence provider API, not the Hibernate API. We don't have a commitment for the latter and we expect most users to configure their apps via JPA. |
If this is the case, can we assume |
The problem is indeed caused by changes in Hibernate's If |
The purpose of this very issue is to investigate a solution… |
In my opinion, the solution could be the same that has been used previously in |
Thanks @BladeWise, but we know what our options are. |
That's the case indeed for such purposes. While the FWIW, All things considered, Hibernate ORM 6.x is only supported via JPA, by design. We have dedicated Hibernate support there in the form of |
It turns out that there is actually a bit of alignment to do: Hibernate 6.2 removed deprecated dialect classes for Derby and PostgreSQL, so we have to use replacements there now for our purposes in |
Includes documentation and test revisions. Closes spring-projectsgh-30288
I found this issue during my migration from Spring Boot 2.7 to 3.2 which have proven to be quite challenging :) I decided several years ago to remove JPA (v2.x at the time) configuration in favor of using Spring/Hibernate with LocalSessionFactoryBean because I kept running into the fact that I needed to unwrap the entity manager to Session in order to use hibernate specific features. And configuration wise, LocalSessionFactoryBean feels a lot more straight forward and easy to use, in my opinion. (But I must admit, that comes from the fact that I'm a lot more used to this type of configuration). So, I just wanted to mention that there would be at least 1 vote for having a orm.hibernate6.LocalSessionFactoryBean :) I got everything working with Spring Boot 3.2 and Hibernate 5.6 so I will stick with that for now. |
Affects: spring-orm 6.0.7 and earlier
In application running spring 6.0.7 and hibernate 6.2.0.final, when spring is creating hibernate session factory in Spring application context exception occurs:
This is caused by the fact that in Hibernate 6.2 has changed return type for the method
Configuration.setImplicitNamingStrategy
(instead of voidConfiguration
is returned).The text was updated successfully, but these errors were encountered: