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

Persist of transient entity in derived ID that is already in merge process throws javax.persistence.EntityExistsException

    Details

    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

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

      Description

      javax.persistence.EntityExistsException: A different object with the same identifier value was already associated with the session : [org.hibernate.bugs.entity.ShoppingCart#cart1]
      
      	at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:116)
      	at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:155)
      	at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:162)
      	at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:899)
      	at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:858)
      	at org.hibernate.engine.spi.CascadingActions$6.cascade(CascadingActions.java:261)
      	at org.hibernate.engine.internal.Cascade.cascadeToOne(Cascade.java:391)
      	at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:316)
      	at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:155)
      	at org.hibernate.engine.internal.Cascade.cascadeCollectionElements(Cascade.java:424)
      	at org.hibernate.engine.internal.Cascade.cascadeCollection(Cascade.java:356)
      	at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:319)
      	at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:155)
      	at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:104)
      	at org.hibernate.event.internal.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:445)
      	at org.hibernate.event.internal.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:239)
      	at org.hibernate.event.internal.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:301)
      	at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:170)
      	at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:69)
      	at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:866)
      	at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:852)
      

        Attachments

          Issue links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: