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

Flush operation after a cascade delete could prejudice commit

Description

With Infinispan remote dialect, a large cascade delete on a bidirectional association and a subsequent flush could bring persistence context in an inconsistent state, causing in turn this error on commit operation:

`javax.persistence.RollbackException: Error while committing the transaction
at org.hibernate.ogm.backendtck.inheritance.singletable.family.SingleTableInheritancePersistTest.testFlushAndCommitAfterCascadeDelete(SingleTableInheritancePersistTest.java:192)
Caused by: java.lang.IllegalStateException: org.hibernate.TransientPropertyValueException: object references an unsaved transient instance - save the transient instance before flushing : org.hibernate.ogm.backendtck.inheritance.singletable.family.Woman.familyName -> org.hibernate.ogm.backendtck.inheritance.singletable.family.Family
at org.hibernate.ogm.backendtck.inheritance.singletable.family.SingleTableInheritancePersistTest.testFlushAndCommitAfterCascadeDelete(SingleTableInheritancePersistTest.java:192)
Caused by: org.hibernate.TransientPropertyValueException: object references an unsaved transient instance - save the transient instance before flushing : org.hibernate.ogm.backendtck.inheritance.singletable.family.Woman.familyName -> org.hibernate.ogm.backendtck.inheritance.singletable.family.Family
`
Test case is here:

Environment

None

Status

Assignee

Fabio Massimo Ercoli

Reporter

Fabio Massimo Ercoli

Labels

None

Worked in

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Community Help Wanted

None

Suitable for new contributors

None

Requires Release Note

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Affects versions

5.4.0.Beta2

Priority

Major