Uploaded image for project: 'Hibernate ORM'
  1. HHH-12592

Merge of detached, enhanced entity with orphanRemoval = true collection fails since 5.2.13

    Details

    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Worked in:
    • Last commented by a user?:
      true
    • Sprint:

      Description

      This is slightly related to the HHH-11459 Closed but here we're trying to merge a detached entity.
      This worked in 5.2.12. Does not in 5.2.13+ including latest 5.3.0.

      The result is

      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.Container.elements
      	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:1437)
      	at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:493)
      	at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:3207)
      	at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2413)
      

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: