IBM Support

PM42172: JPA metadata data contained in a mapping file (orm.xml) is not READ PRIOR TO FIRST RUN OF A QUERY.

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • User is seeing an exception similar to the following when
    running a query, where the query is defined in a mapping
    file (orm.xml):
    
    Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException:
    ORA-00904: "T0"."MYSTATUS_OID": invalid identifier {prepstmnt
    559489369 SELECT t0.OID, t0.version FROM MY_TABLE t0,
    MY_OTHER_TABLE t1 WHERE t0.MYSTATUS_OID = t1.ID
    
    The MYSTASUS_OID column doesn't exist in the user's database, so
    the exception is correct, however, the correct column name which
    OpenJPA should be looking for is MY_STATUS_OID.  In this case
    OpenJPA is using the wrong column name.
    A couple things to note:
    1) The query works correctly if a finder is run prior to the
    query.
    2) The query works correctly when the query definition is
    removed from the orm.xml file, and moved to the persistence.xml
    file.
    

Local fix

  • Fix in next release.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server V8.0.0 who define query strings in   *
    *                  mapping (orm.xml) files.                    *
    ****************************************************************
    * PROBLEM DESCRIPTION: Prevent reparsing annotation metadata   *
    *                      for queries.                            *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    When a query is defined in a mapping file (orm.xml), metadata
    for the query may not be found upon first run of the query.
    To prevent this issue, you must set a custom property.  The
    property name is 'openjpa.Compatibility'and takes a value
    'ParseAnnotationsForQueryMode=false'.  This property can be
    set as a JVM custom property, or in a persistence.xml file, as
    follows:
    <property name="openjpa.Compatibility"
    value="ParseAnnotationsForQueryMode=false"/>
    

Problem conclusion

  • With this fix, when enabled, query metadata will be property
    read for queries defined in mapping files.
    
    The fix for this APAR is currently targeted for inclusion in
    Service Level (Fix Pack) 8.0.0.2 of WebSphere Application
    Server version 8.0.0.
    
    Please refer to the recommended updates page for delivery
    information:
    http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
    

Temporary fix

Comments

APAR Information

  • APAR number

    PM42172

  • Reported component name

    WEBSPHERE APP S

  • Reported component ID

    5724J0800

  • Reported release

    800

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2011-06-21

  • Closed date

    2011-09-08

  • Last modified date

    2011-11-15

  • APAR is sysrouted FROM one or more of the following:

    PM37572

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    WEBSPHERE APP S

  • Fixed component ID

    5724J0800

Applicable component levels

  • R800 PSY

       UP

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"8.0","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
27 October 2021