[hibernate-issues] [JIRA] (HHH-14061) No session exception with entityManager.clear() with Envers in JTA transaction

LAdO (JIRA) jira at hibernate.atlassian.net
Fri Jun 5 03:00:36 EDT 2020


LAdO ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A1457ac20-703a-4313-96f5-fa81da333677 ) *created* an issue

Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYWY4NzA0ODViNDdlNDY0NmE2ZjE1ODgxZDU5MWIyZmMiLCJwIjoiaiJ9 ) / Bug ( https://hibernate.atlassian.net/browse/HHH-14061?atlOrigin=eyJpIjoiYWY4NzA0ODViNDdlNDY0NmE2ZjE1ODgxZDU5MWIyZmMiLCJwIjoiaiJ9 ) HHH-14061 ( https://hibernate.atlassian.net/browse/HHH-14061?atlOrigin=eyJpIjoiYWY4NzA0ODViNDdlNDY0NmE2ZjE1ODgxZDU5MWIyZmMiLCJwIjoiaiJ9 ) No session exception with entityManager.clear() with Envers in JTA transaction ( https://hibernate.atlassian.net/browse/HHH-14061?atlOrigin=eyJpIjoiYWY4NzA0ODViNDdlNDY0NmE2ZjE1ODgxZDU5MWIyZmMiLCJwIjoiaiJ9 )

Issue Type: Bug Assignee: Chris Cranford ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Aea49f1db-ef91-4d96-8f3a-a939be8d2b1c ) Components: hibernate-envers Created: 05/Jun/2020 00:00 AM Priority: Major Reporter: LAdO ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A1457ac20-703a-4313-96f5-fa81da333677 )

HHH-13760 ( https://hibernate.atlassian.net/browse/HHH-13760 ) causes regression under specific conditions.
When entityManager.clear() is called in a JTA transaction with FlushMode.MANUAL, the changed entity must have a @ManyToOne Lazy reference and must add or remove an item from the @OneToMany collection.
An error occures after entityManager.close() and commit (simulates spring jta transaction).

> 
> 
> 
> ...
> Caused by: org.hibernate.LazyInitializationException: could not initialize
> proxy org.hibernate.envers.test.entities.onetomany.SetRefIngEntity#3 ( #3 )
> - no Session
> at
> org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:170)
> 
> at
> org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:310)
> 
> at
> org.hibernate.envers.internal.entities.mapper.relation.ToOneIdMapper.mapToMapFromEntity(ToOneIdMapper.java:62)
> 
> at
> org.hibernate.envers.internal.entities.mapper.MultiPropertyMapper$1.run(MultiPropertyMapper.java:137)
> 
> at
> org.hibernate.envers.internal.entities.mapper.MultiPropertyMapper$1.run(MultiPropertyMapper.java:105)
> 
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.hibernate.envers.internal.entities.mapper.MultiPropertyMapper.mapToMapFromEntity(MultiPropertyMapper.java:104)
> 
> at
> org.hibernate.envers.internal.synchronization.work.CollectionChangeWorkUnit.generateData(CollectionChangeWorkUnit.java:54)
> 
> 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:164)
> 
> 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:2379)
> 
> at
> org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:447)
> 
> at
> org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorImpl.beforeCompletion(JtaTransactionCoordinatorImpl.java:355)
> 
> at
> org.hibernate.resource.transaction.backend.jta.internal.synchronization.SynchronizationCallbackCoordinatorNonTrackingImpl.beforeCompletion(SynchronizationCallbackCoordinatorNonTrackingImpl.java:47)
> 
> at
> org.hibernate.resource.transaction.backend.jta.internal.synchronization.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:37)
> 
> at
> com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
> 
> at
> com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)
> 
> at
> com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)
> 
> at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:164)
> at
> com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)
> 
> ... 61 more
> 
> 

However, I'm not sure if the call to entityManager.close () is used correctly in this context.

( https://hibernate.atlassian.net/browse/HHH-14061#add-comment?atlOrigin=eyJpIjoiYWY4NzA0ODViNDdlNDY0NmE2ZjE1ODgxZDU5MWIyZmMiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-14061#add-comment?atlOrigin=eyJpIjoiYWY4NzA0ODViNDdlNDY0NmE2ZjE1ODgxZDU5MWIyZmMiLCJwIjoiaiJ9 )

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.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100128- sha1:078e4e4 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200605/8e05e04e/attachment.html 


More information about the hibernate-issues mailing list