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

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

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:

1 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

1 2 3 4 5 6 7 8 9 10 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

Environment

None

Status

Assignee

Chris Cranford

Reporter

Anton Mityagin

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.2.12

Components

Affects versions

5.3.3

Priority

Major