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

Merge cascade of collection fails when orphan removal enabled with flush mode commit

    Details

    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

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

      Description

      I've recently posted bug report HHH-12826.
      Now I've got new version 5.3.3 and get new exception while merging object with collection:

      javax.persistence.PersistenceException: org.hibernate.TypeMismatchException: Provided id of the wrong type for class org.hibernate.bugs.model.DocumentLineA. Expected: class java.lang.Long, got class org.hibernate.action.internal.DelayedPostInsertIdentifier
      

      when flushMode is not auto and code is

      DocumentA doc = new DocumentA();
      		
      doc.setNumber("1");
      doc.setDate(new Date());
      		
      entityManager.persist(doc);
      		
      doc.addLine( new DocumentLineA("line1") );
      		
      entityManager.merge(doc);
      

      test case attached

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: