IBM Support

PH12133: ECLIPSELINK RETURNS THE WRONG RESULT FOR LEFT JOINS WITH EMPTY RESULTS FROM THE RIGHT

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Given a JPQL query that contains a LEFT JOIN expression,
    EclipseLink's JPQL processing generates a query that does
    not
    account for possible empty (NULL) results from the right
    side of
    the join.
    

Local fix

  • N/A
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server - Java Persistence API - JPA 2.1 &   *
    *                  EclipseLink                                 *
    ****************************************************************
    * PROBLEM DESCRIPTION: EclipseLink generates an incorrect      *
    *                      LEFT                                    *
    *                      JOIN statement that returns incorrect   *
    *                      results when the right side of the      *
    *                      join                                    *
    *                      is emtpy                                *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    When creating a JPQL query that contains a LEFT JOIN,
    EclipseLink will generate SQL that incorrectly accounts for the
    right side of the join
    For example, consider the following query:
    Query q = em.createQuery("SELECT sub1, sub2 from SubClass
    sub1 LEFT OUTER JOIN SubClass sub2 ON sub2.name = 'unknown'");
    *Note that there are no results in the table for name='unknown'
    EclipseLink will generate a query similar to this:
    "SELECT t0.ID, t0.DTYPE, t0.NAME, t1.ID, t1.DTYPE, t1.NAME
    FROM SUPERCLASS t0 LEFT OUTER JOIN SUPERCLASS t1 ON (t1.NAME =
    'unknown') WHERE (((t0.DTYPE = 'Sub') AND (t1.DTYPE = 'Sub'))
    AND (t1.DTYPE = 'Sub'))"
    With this query, EclipseLink contains too many DTYPE checks and
    fails to account for DTYPE==NULL that will occur when the right
    side of the LEFT JOIN is empty.
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    PH12133

  • Reported component name

    WAS LIBERTY COR

  • Reported component ID

    5725L2900

  • Reported release

    855

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2019-05-15

  • Closed date

    2019-06-28

  • Last modified date

    2020-02-03

  • 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

    WAS LIBERTY COR

  • Fixed component ID

    5725L2900

Applicable component levels

  • R855 PSY

       UP

[{"Line of Business":{"code":"LOB36","label":"IBM Automation"},"Business Unit":{"code":"BU053","label":"Cloud \u0026 Data Platform"},"Product":{"code":"SSD28V","label":"WebSphere Application Server Liberty Core"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"855"}]

Document Information

Modified date:
16 September 2021