IBM Support

PI94027: ECLIPSELINK JPQL GENERATION FOR NESTED ARRAYS WITH 'IN' EXPRESSION

Fixes are available

18.0.0.2: WebSphere Application Server Liberty 18.0.0.2
18.0.0.3: WebSphere Application Server Liberty 18.0.0.3
18.0.0.4: WebSphere Application Server Liberty 18.0.0.4
19.0.0.1: WebSphere Application Server Liberty 19.0.0.1
19.0.0.2: WebSphere Application Server Liberty 19.0.0.2
19.0.0.3: WebSphere Application Server Liberty 19.0.0.3
19.0.0.4: WebSphere Application Server Liberty 19.0.0.4
19.0.0.5: WebSphere Application Server Liberty 19.0.0.5
19.0.0.6: WebSphere Application Server Liberty 19.0.0.6
19.0.0.7: WebSphere Application Server Liberty 19.0.0.7
19.0.0.8: WebSphere Application Server Liberty 19.0.0.8
19.0.0.9: WebSphere Application Server Liberty 19.0.0.9
19.0.0.10: WebSphere Application Server Liberty 19.0.0.10
19.0.0.11: WebSphere Application Server Liberty 19.0.0.11
19.0.0.12: WebSphere Application Server Liberty 19.0.0.12
20.0.0.1: WebSphere Application Server Liberty 20.0.0.1
20.0.0.2: WebSphere Application Server Liberty 20.0.0.2
20.0.0.3: WebSphere Application Server Liberty 20.0.0.3
20.0.0.4: WebSphere Application Server Liberty 20.0.0.4
20.0.0.5: WebSphere Application Server Liberty 20.0.0.5
20.0.0.6: WebSphere Application Server Liberty 20.0.0.6
20.0.0.7: WebSphere Application Server Liberty 20.0.0.7
20.0.0.8: WebSphere Application Server Liberty 20.0.0.8
20.0.0.9: WebSphere Application Server Liberty 20.0.0.9
20.0.0.10: WebSphere Application Server Liberty 20.0.0.10
20.0.0.11: WebSphere Application Server Liberty 20.0.0.11
20.0.0.12: WebSphere Application Server Liberty 20.0.0.12

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The JPA persistence provider EclipseLink generates incorrect
    SQL
    for JPQL statements containing 'IN' expressions
    

Local fix

  • N/A
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server Liberty - Java Persistence API       *
    *                  (JPA)                                       *
    ****************************************************************
    * PROBLEM DESCRIPTION: EclipseLink generates incorrect SQL     *
    *                      statements for JPQL that contains       *
    *                      aliases in an IN clause                 *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    Here are some examples of JPQL that result in incorrect SQL
    statements.
    
    //JPQL Query #1:
    Query q = em.createQuery("select t0.id from SomeEntity t0 where
    (t0.someString1, t0.someString2) in (select t1.someString1,
    t1.someString1 from SomeEntity t1)");
    
    //Generated statement:
    //SELECT t0.value1, t0.value2 FROM parentTable t0 WHERE
    (parentTable.someString1, parentTable.someString2) IN (SELECT
    t1.someString1, t1.someString1 FROM parentTable t1)
    
    Issue:
    This generated statement is invalid here because as you can see,
    the aliases were not correctly generated. This leads to an
    exception upon execution.
    
    //JPQL Query #2:
    Query q = em.createQuery("select t0.id from SomeEntity t0 where
    (t0.otherEntity.otherString1, t0.someString1) in (select
    t1.someString1, t1.someString2 from SomeEntity t1)");
    
    //Generated statement:
    //SELECT t0.value1, t0.value2 FROM parentTable t0, parentTable
    t2, otherTable t1 WHERE ((t1.otherString1, t2.someString1) IN
    (SELECT t3.someString1, t3.someString2 FROM parentTable t3) AND
    ((t1.value2 = t2.fkOtherValue2) AND (t1.value1 =
    t2.fkOtherValue1)))
    
    Issue:
    This generated statement is invalid since 't0' is not referenced
    within the generated query. Instead, EclipseLink seems to use
    this 'otherTable' reference.
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    PI94027

  • 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

    2018-02-21

  • Closed date

    2018-05-08

  • Last modified date

    2018-05-08

  • 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

[{"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","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
18 October 2021