Luís Alves (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *commented* on HHH-7510 (
https://hibernate.atlassian.net/browse/HHH-7510?atlOrigin=eyJpIjoiZWJlMGF...
)
Re: LazyInitializationException thrown when deleting an entity while
global_with_modified_flag turned on (
https://hibernate.atlassian.net/browse/HHH-7510?atlOrigin=eyJpIjoiZWJlMGF...
)
I’m running version 5.6.10.Final and it seems that I have similar problem to the one
reported here.
Here is the stacktrace:
Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a
collection, could not initialize proxy - no Session
at
org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:614)
at
org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:218)
at
org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:162)
at org.hibernate.collection.internal.PersistentBag.isEmpty(PersistentBag.java:376)
at
org.hibernate.envers.internal.entities.mapper.relation.AbstractCollectionMapper.isFromNullToEmptyOrFromEmptyToNull(AbstractCollectionMapper.java:206)
at
org.hibernate.envers.internal.entities.mapper.relation.AbstractCollectionMapper.mapModifiedFlagsToMapFromEntity(AbstractCollectionMapper.java:172)
at
org.hibernate.envers.internal.entities.mapper.MultiPropertyMapper.map(MultiPropertyMapper.java:91)
at
org.hibernate.envers.internal.synchronization.work.DelWorkUnit.generateData(DelWorkUnit.java:62)
at
org.hibernate.envers.internal.synchronization.work.AbstractAuditWorkUnit.perform(AbstractAuditWorkUnit.java:66)
at
org.hibernate.envers.internal.synchronization.AuditProcess.executeInSession(AuditProcess.java:125)
at
org.hibernate.envers.internal.synchronization.AuditProcess.doBeforeTransactionCompletion(AuditProcess.java:175)
at
org.hibernate.envers.internal.synchronization.AuditProcessManager$1.doBeforeTransactionCompletion(AuditProcessManager.java:47)
at
org.hibernate.engine.spi.ActionQueue$BeforeTransactionCompletionProcessQueue.beforeTransactionCompletion(ActionQueue.java:954)
at
org.hibernate.engine.spi.ActionQueue.beforeTransactionCompletion(ActionQueue.java:525)
at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2426)
at
org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:449)
at
org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:183)
at
org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$300(JdbcResourceLocalTransactionCoordinatorImpl.java:40)
at
org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:281)
at
org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:101)
at
org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:562)
This happens when I delete a OneToMany relationship that has children after running a
test. When empty the cleanup after test runs successfully. The only difference is that I
don’t have the global flag, but instead @Audited(withModifiedFlag = true. Enabling
enable_lazy_load_no_trans: true cause a NPE instead.
Might the bug still exist?
(
https://hibernate.atlassian.net/browse/HHH-7510#add-comment?atlOrigin=eyJ...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-7510#add-comment?atlOrigin=eyJ...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100204- sha1:3bd651e )