You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
BTW, according to hibernate the whole foreign key logic has been heavily rewritten, so maybe we need to update the SpringHibernateJpaPersistenceProvider
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.
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).
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...
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.
Activity
spring-projects-issues commentedon May 9, 2015
Juergen Hoeller commented
Committed support for Hibernate 5.0 Beta 2: full native support in a
org.springframework.orm.hibernate5package as well as a revisedSpringHibernateJpaPersistenceProvider.To be upgraded to Hibernate 5.0 RC1 before Spring Framework 4.2 goes GA.
Juergen
spring-projects-issues commentedon May 13, 2015
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 commentedon May 13, 2015
Petar Tahchiev commented
BTW, according to hibernate the whole foreign key logic has been heavily rewritten, so maybe we need to update the
SpringHibernateJpaPersistenceProviderspring-projects-issues commentedon May 13, 2015
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 commentedon May 14, 2015
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 commentedon May 14, 2015
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 commentedon May 15, 2015
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
EntityManagerFactorycreations which easily appear in Spring based integration tests. We're just usinghibernate.hbm2ddl.autoset toupdate, so nothing really fancy here.