Maxim Solodovnik created OPENJPA-2968:
-----------------------------------------

             Summary: IdClass paths swallow exceptions and rely on field order
                 Key: OPENJPA-2968
                 URL: https://issues.apache.org/jira/browse/OPENJPA-2968
             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_r3683003006


**(medium)** The IdClass reconstruction/extraction paths `catch (Exception)` 
and silently continue (here the field stays null; in `toDataStoreValue` at line 
227 the PK columns get nulls written). Swallowing exceptions around primary-key 
values risks silently persisting/loading corrupt identities - at minimum a warn 
log, arguably a StoreException. Also `getInstanceFields` (line 448) maps 
IdClass fields to columns by `getDeclaredFields()` order, which the JVM does 
not guarantee - matching by name would be safer.



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

Reply via email to