We're updating the issue view to help you get more done. 

Bytecode-enhanced Entity cannot be merged or refreshed

Description

When I try to refresh managed bytecode-enhanced entity, I am getting an exception:

Caused by: org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: org.hibernate.bugs.model.Person.details
at org.hibernate.engine.internal.Collections.processDereferencedCollection(Collections.java:99)
at org.hibernate.engine.internal.Collections.processUnreachableCollection(Collections.java:50)
at org.hibernate.event.internal.AbstractFlushingEventListener.flushCollections(AbstractFlushingEventListener.java:243)
at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:86)
at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:38)
at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1428)
at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:484)
at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:3190)
at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2404)

Environment

JPA, Java 8, Postgres/H2

Status

Assignee

Luis Barreiro

Reporter

Oleg Chernobay

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

5.2.7

Priority

Major