Skip to content

Support for Hibernate ORM 5.0 [SPR-11694] #16316

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

Closed
spring-projects-issues opened this issue Apr 14, 2014 · 7 comments
Closed

Support for Hibernate ORM 5.0 [SPR-11694] #16316

spring-projects-issues opened this issue Apr 14, 2014 · 7 comments
Assignees
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Apr 14, 2014

Juergen Hoeller opened SPR-11694 and commented

Hibernate 5.0 is in beta as of April 2015. Let's track Hibernate 5.0 for support in Spring Framework 4.2 - in a separate "orm.hibernate5" package, as usual.


Issue Links:

Referenced from: commits 94f9a0b, f9c3910, cf0a916

0 votes, 9 watchers

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Committed support for Hibernate 5.0 Beta 2: full native support in a org.springframework.orm.hibernate5 package as well as a revised SpringHibernateJpaPersistenceProvider.

To be upgraded to Hibernate 5.0 RC1 before Spring Framework 4.2 goes GA.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Petar Tahchiev commented

Hi @juergen,

I'm facing issues with spring and hibernate5 beta2 - I get a duplicate foreignkey exception. I spoke with the hibernate team and they proved that when using only hibernate api then this exception does not occur. I tried to build against the latest snapshot but I get the same exception - only when using spring-orm. Here's my repository:
https://github.com/paranoiabla/hibernate-hsql-issue

@spring-projects-issues
Copy link
Collaborator Author

Petar Tahchiev commented

BTW, according to hibernate the whole foreign key logic has been heavily rewritten, so maybe we need to update the SpringHibernateJpaPersistenceProvider

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

We're not doing anything unusual in that area, as far as I'm aware. I'm surprised that a foreign key exception would only arise when using it with Spring... Does a plain non-Spring Hibernate EntityManager setup work there? Since even if it works with a native Hibernate Session, it could still be a bug in Hibernate's EntityManager implementation... That said, if it is indeed a Spring-only problem, I'll have a look at it ASAP.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Petar Tahchiev commented

Hi Juergen,

thanks for your feedback. Yes, indeed, this appears to happen only when we have spring involved. The sample project contains a test-case from Steve Ebersole from hibernate which works fine (no spring involved there).

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Looking at the test case, it seems that the problem isn't even in the Session or EntityManager but rather in the SchemaUpdate tool? Even more surprising that the presence of Spring makes a difference there. I'll see what I can find out...

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Oliver Drotbohm commented

Adding a build profile for [Hibernate 5.0 for Spring Data JPA|DATAJPA-703] has revealed the newly written schema updater quite brittle. We've found the foreign key creation being broken which was fixed for Beta 2. Current snapshots nonetheless are already broken again with the schema creation being re-triggered.

To me it doesn't feel like Spring being involved causing the issue here but Hibernate not correctly analyzing that schema to update during multiple EntityManagerFactory creations which easily appear in Spring based integration tests. We're just using hibernate.hbm2ddl.auto set to update, so nothing really fancy here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants