Skip to content

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

Closed

Description

@spring-projects-issues

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

Activity

  1. spring-projects-issues commented on May 9, 2015

    @spring-projects-issues
    CollaboratorAuthor

    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

  2. spring-projects-issues commented on May 13, 2015

    @spring-projects-issues
    CollaboratorAuthor

    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

  3. spring-projects-issues commented on May 13, 2015

    @spring-projects-issues
    CollaboratorAuthor

    Petar Tahchiev commented

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

  4. spring-projects-issues commented on May 13, 2015

    @spring-projects-issues
    CollaboratorAuthor

    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

  5. spring-projects-issues commented on May 14, 2015

    @spring-projects-issues
    CollaboratorAuthor

    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).

  6. spring-projects-issues commented on May 14, 2015

    @spring-projects-issues
    CollaboratorAuthor

    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

  7. spring-projects-issues commented on May 15, 2015

    @spring-projects-issues
    CollaboratorAuthor

    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.

  8. added
    in: data
    type: enhancement
    on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: datatype: enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions