IBM Support

PI32689: OPENJPA FAILS TO RECOMPUTE THE JPQL WHEN A NULL FIELD OF AN EMBEDDED PRIMARY KEY IS NOW CORRECTLY FILLED

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • An entity uses an embeded primary key composed by two fields.
    
    On the first call to the entityManager by using the "find" (by
    primary key) method, OpenJPA will build the jpql request. If
    one of the two fields of the embeded primary key is null,
    OpenJPA will replace this by "IS NULL" in the generated jpql
    string. This generated jpql request is put in a finder cache.
    
    On subsequent calls, OpenJPA will retreive the generated jpql
    from cache. However, if the field that was null in the embedded
    key is now correctly filled in, OpenJPA will not try to
    recompute the jpql, but will try to set the parameter in the
    jdbc preparedStatement. This will raise an exception.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server V8.0.0, V8.5.0, and V8.5.5 who make  *
    *                  use of the OpenJPA FinderCache.             *
    ****************************************************************
    * PROBLEM DESCRIPTION: OpenJPA FinderCache contains            *
    *                      incorrectly cached query with a NULL    *
    *                      for a Primary Key.                      *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    Take the following SQL from a finder:
    SELECT t1.code, t1.EXTDISCR, t0.field1, t0.field2 FROM TB1 t0
    LEFT OUTER JOIN AbstractExtValue t1 ON t0.EXT_USR = t1.code
    WHERE (t1.EXTDISCR IS NULL OR t1.EXTDISCR IN ?) AND t0.field1
    = ? AND t0.field2 IS NULL
    Notice the 't0.field2 IS NULL' part. Field2 is part of a
    compound PK of table 'TB1', where the compound PK consists of
    two fields (field1 and field2).  Because the PK field 'IS
    NULL', this finder query should NOT be added to the OpenJPA
    FinderQuery cache (i.e. OpenJPA can't cache something which is
    "hard coded" to 'IS NULL'....in the case where field2 is
    non-null, the query will never account for that). However,
    this query is in fact incorrectly added to the cache.  Because
    the query is cached with 'IS NULL' for field2, any time this
    query is run field2 can never be changed to a non-null value.
    

Problem conclusion

  • With this fix, code has been added to OpenJPA to avoid caching
    a query in the FinderCache which contains a hard coded value
    as one of the parameters.
    
    The fix for this APAR is currently targeted for
    inclusion in Service Levels (Fix Packs) 8.0.0.11 and
    8.5.5.6 of WebSphere Application Server versions 8.0.0 and
    8.5.5.
    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

    PI32689

  • Reported component name

    WEBS APP SERV N

  • Reported component ID

    5724H8800

  • Reported release

    800

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2015-01-14

  • Closed date

    2015-04-14

  • Last modified date

    2015-04-14

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

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

Fix information

  • Fixed component name

    WEBS APP SERV N

  • Fixed component ID

    5724H8800

Applicable component levels

  • R800 PSY

       UP

  • R850 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 April 2022