In a particular case as described below, order-inserts = true causes FK Violation, while order-inserts = false does not: # A entity refers to B entity in a OneToOne unidirectional relationship # P entity refers to Q entity in a OneToOne unidirectional relationship # A refers to a list of P entities in a OneToMany relationship, the ID of A is stored in P. P does not have an object reference to A in the class definition. # All above entities have auto-generated/db-generated IDs # When executing the following operations in order an FK violation occurs: * Persist A * Persist Q [Not required if cascadetype = persist on P->Q] * Set ID of A in P * Persist P [We only need 1 P to reproduce this issue] * Persist B
Due to fixes made in ActionQueue to solve issue HHH-13068, the order of the above insert statements is now flawed. While inserts should be in order: BAQP, inserts are instead sorted into order QPBA causing an FK Violation in P's FK reference to A.
This issue is reproducable on versions with the HHH-13068 fix, that being versions 5.4.1 and 5.4.2.
Attaching Testcase shortly. |
|