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
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?
The text was updated successfully, but these errors were encountered:
Same with 5.5.3.Final
The session can be printed with System.out.println(entityManager);
I noticed that it changes when MockitoAnnotations.openMocks(this) is called.
The error can be provoked by calling transaction.commit() after entityManager.persist(entity). Some commits work others don't.
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:
With 5.3.18.Final all persistence tests fail with:
Maybe it has to do with how we initialize the persistence context during tests?
The text was updated successfully, but these errors were encountered: