IBM Support

PM89432: ISOLATION LEVEL IS NOT WORKING PROPERLY FOR JPQL QUERIES WITH NESTED SUB-QUERIES. IT IS GENERATING INCORRECT QUERY.

Fixes are available

8.0.0.8: WebSphere Application Server V8.0 Fix Pack 8
8.5.5.2: WebSphere Application Server V8.5.5 Fix Pack 2
8.0.0.9: WebSphere Application Server V8.0 Fix Pack 9
8.5.5.3: WebSphere Application Server V8.5.5 Fix Pack 3
8.5.5.4: WebSphere Application Server V8.5.5 Fix Pack 4
8.0.0.10: WebSphere Application Server V8.0 Fix Pack 10
8.5.5.5: WebSphere Application Server V8.5.5 Fix Pack 5
8.5.5.6: WebSphere Application Server V8.5.5 Fix Pack 6
8.0.0.11: WebSphere Application Server V8.0 Fix Pack 11
8.5.5.7: WebSphere Application Server V8.5.5 Fix Pack 7
8.5.5.8: WebSphere Application Server V8.5.5 Fix Pack 8
8.0.0.12: WebSphere Application Server V8.0 Fix Pack 12
8.5.5.9: WebSphere Application Server V8.5.5 Fix Pack 9
8.5.5.10: WebSphere Application Server V8.5.5 Fix Pack 10
8.5.5.11: WebSphere Application Server V8.5.5 Fix Pack 11
8.0.0.13: WebSphere Application Server V8.0 Fix Pack 13
8.5.5.12: WebSphere Application Server V8.5.5 Fix Pack 12
8.0.0.14: WebSphere Application Server V8.0 Fix Pack 14
8.5.5.13: WebSphere Application Server V8.5.5 Fix Pack 13
8.0.0.15: WebSphere Application Server V8.0 Fix Pack 15
8.5.5.14: WebSphere Application Server V8.5.5 Fix Pack 14
8.5.5.15: WebSphere Application Server V8.5.5 Fix Pack 15
8.5.5.14: WebSphere Application Server V8.5.5 Fix Pack 14
8.5.5.17: WebSphere Application Server V8.5.5 Fix Pack 17
8.5.5.20: WebSphere Application Server V8.5.5.20
8.5.5.18: WebSphere Application Server V8.5.5 Fix Pack 18
8.5.5.19: WebSphere Application Server V8.5.5 Fix Pack 19
8.5.5.16: WebSphere Application Server V8.5.5 Fix Pack 16
8.5.5.21: WebSphere Application Server V8.5.5.21

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Isolation level is not working properly for JPQL queries with
    nested sub-queries. It is generating incorrect query.
    

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 JPA isolation level query hints      *
    *                  against DB2.                                *
    ****************************************************************
    * PROBLEM DESCRIPTION: Isolation level is not working          *
    *                      properly on DB2 for JPQL queries with   *
    *                      nested sub-queries.                     *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    Isolation level hint is not properly working on DB2 for JPQL
    queries with nested sub-queries. OpenJPA generates an incorrect
    query, which can be seen in the example below.  One can notice
    that the query is generated with "WITH UR ¢â‚¬  ½ suffix to
    both nested sub-query as well as the outer main query. As per
    SQL syntax, it should be adding  ¢â‚¬ “WITH UR ¢â‚¬  ½ only at o
    query level.  Take the following query hints and JPQL Query:
    -- Query Hints used:
    query.setHint("openjpa.FetchPlan.Isolation",
    "read-uncommitted");
    query.setHint("openjpa.FetchPlan.ReadLockMode", "READ");
    -- JPQL Query:
    SELECT m FROM AnEntity m WHERE m.id.memberIdTd = :memberIdTd
    AND m.id.entryTimestamp IN
    (SELECT max(b.id.entryTimestamp) FROM AnEntity b WHERE
    b.id.memberIdTd = :memberIdTd)
    With this, the following query is generated (note the "WITH
    UR" string):
    SELECT t0.ENTRY_TIMESTAMP, t0.MEMBER_ID_TD, t0.CREATED_BY,
    t0.DEPT_CD,
    t0.EVENT_CLASS,t0.EVENT_DT,t0.EVENT_PRIORITY_IND,t0.EVENT_REMARK
    S,
    t0.EVENT_STATUS,t0.EVENT_TYPE,t0.LAST_MOD_DATE,t0.LAST_MOD_USER,
    t0.LEGAL_COUNSEL_IND,t0.SYSTEM_CD
    FROM DBA.ANENTITY t0
    WHERE
    ( t0.MEMBER_ID_TD = ? AND t0.ENTRY_TIMESTAMP IN
    ( SELECT MAX(t1.ENTRY_TIMESTAMP) FROM DBA.ANENTITY t1
    WHERE ( t1.MEMBER_ID_TD = ?
    ) FOR READ ONLY WITH UR
    )
    ) optimize for 1 row FOR READ ONLY WITH UR
    

Problem conclusion

  • With this fix, code has been added to OpenJPA to generate the
    proper SQL for DB2 when isolation level query hints are used.
    
    The fix for this APAR is currently targeted for
    inclusion in Service Levels (Fix Packs) 8.0.0.8 and 8.5.5.2 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

    PM89432

  • Reported component name

    WEBS APP SERV N

  • Reported component ID

    5724H8800

  • Reported release

    800

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-05-21

  • Closed date

    2013-08-29

  • Last modified date

    2013-08-29

  • 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:
28 April 2022