You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Maxim Solodovnik (Jira)" <ji...@apache.org> on 2026/08/20 07:34:00 UTC

[jira] [Created] (OPENJPA-2952) Transient object wrongly assumed detached in flush check

Maxim Solodovnik created OPENJPA-2952:
-----------------------------------------

             Summary: Transient object wrongly assumed detached in flush check
                 Key: OPENJPA-2952
                 URL: https://issues.apache.org/jira/browse/OPENJPA-2952
             Project: OpenJPA
          Issue Type: Sub-task
          Components: jpa
    Affects Versions: 4.2.0
            Reporter: Maxim Solodovnik
             Fix For: 4.2.0


Discussion thread: https://github.com/apache/openjpa/pull/144#discussion_r3682999635


**(medium)** This early-return treats any unmanageable instance of a known entity type as detached without verifying it was ever persisted, so a truly transient unenhanced object referenced without cascade now passes the check and fails later (or silently persists a broken FK). Line 824 also adds `_broker.isDetached(obj, true)`, a DB round-trip inside the flush path for every manageable object without a state manager. Can both paths at least verify a non-null/assigned identity before assuming detached?



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