Skip to content

Update hibernate to latest version #564

@yvespp

Description

@yvespp

I tried to updated hibernate but tests started to fail. Once we have updated hibernate we can also update the java ee API versions.
Ref: #563

With 5.4.20.Final multiple tests fail with this error:

[ERROR] ch.puzzle.itc.mobiliar.test.PersistingEntityBuilderTest.testAmw  Time elapsed: 0.846 s  <<< ERROR!
javax.persistence.PersistenceException:
org.hibernate.HibernateException: Illegal attempt to associate a collection with two open sessions. Collection : [ch.puzzle.itc.mobiliar.business.resourcegroup.entity.ResourceEntity.consumedMasterRelations#1]
Collection contents: [[]]
        at ch.puzzle.itc.mobiliar.test.PersistingEntityBuilderTest.testAmw(PersistingEntityBuilderTest.java:80)
Caused by: org.hibernate.HibernateException:
Illegal attempt to associate a collection with two open sessions. Collection : [ch.puzzle.itc.mobiliar.business.resourcegroup.entity.ResourceEntity.consumedMasterRelations#1]
Collection contents: [[]]
        at ch.puzzle.itc.mobiliar.test.PersistingEntityBuilderTest.testAmw(PersistingEntityBuilderTest.java:80)

With 5.3.18.Final all persistence tests fail with:

Cannot mock/spy class org.hibernate.internal.SessionImpl
Mockito cannot mock/spy because :
 - final class
        at ch.puzzle.itc.mobiliar.business.template.control.TemplatesScreenDomainServicePersistenceTest.before(TemplatesScreenDomainServicePersistenceTest.java:56)

Maybe it has to do with how we initialize the persistence context during tests?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions