You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Jadon Hansell (Jira)" <ji...@apache.org> on 2025/05/15 21:56:00 UTC

[jira] [Updated] (CAY-2890) Vertical Inheritance: Updating 1-Many with FK on Child Table Fails

     [ https://issues.apache.org/jira/browse/CAY-2890?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jadon Hansell updated CAY-2890:
-------------------------------
    Attachment: 2890-one-to-many-breaking-test.patch

> Vertical Inheritance: Updating 1-Many with FK on Child Table Fails
> ------------------------------------------------------------------
>
>                 Key: CAY-2890
>                 URL: https://issues.apache.org/jira/browse/CAY-2890
>             Project: Cayenne
>          Issue Type: Bug
>    Affects Versions: 4.2.2, 5.0-M2
>            Reporter: Jadon Hansell
>            Priority: Major
>         Attachments: 2890-one-to-many-breaking-test.patch
>
>
> If there is a one-to-many relationship where the foreign key is on the child table in a vertical inheritance scenario, updating the relationship will sometimes delete the row on the child table or try to insert a row with mostly null values into the child table instead of updating it.
> The issue seems to happen when the update to the has-many side of the relationship is processed first in `ArcValuesCreationHandler.processFlattenedPath`. When the update to the belongs-to side of the relationship is processed first it issues an update as normal, then skips the has-many side because the inverse relationship has already been processed.
> As a side note, when I implemented a breaking test for this, on one of the test cases cases the GraphBasedDbRowOpSorter throws an error saying that there is a `Cycle detected in list for keys`.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)