IBM Support

PH18844: ECLIPSELINKS COALESCE() JPQL FUNCTION CANNOT HANDLE NULL PARAMETER VALUES

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 

APAR status

  • Closed as program error.

Error description

  • With null parameter values passed to EclipseLink's COALESCE()
    function, in JPQL, EclipseLink can incorrectly assume the JDBC
    type and an exception can be thrown from the JDBC driver due
    to incorrect type
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server - Java Persistence API - JPA 2.1 &   *
    *                  EclipseLink                                 *
    ****************************************************************
    * PROBLEM DESCRIPTION: Setting a query parameter value         *
    *                      to null with Coalese() causes           *
    *                      EclipseLink to throw an exception       *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    Example:
    String jpql = "select count(1) from Employee e where e.salary
    = coalesce(e.salary, :sal)";
    Query query = em.createQuery(jpql);
    query = query.setParameter("sal", null); // null parameter
    value
    Long result = (Long)query.getSingleResult();
    When executing this example, EclipseLink incorrectly assumes
    the parameter type to be a String. If the real attribute type
    is Numeric, EclipseLink throws an exception when setting NULL
    with an invalid type.
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    PH18844

  • Reported component name

    WEBSPHERE APP S

  • Reported component ID

    5724J0800

  • Reported release

    900

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2019-11-06

  • Closed date

    2020-01-20

  • Last modified date

    2020-01-20

  • 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

    WEBSPHERE APP S

  • Fixed component ID

    5724J0800

Applicable component levels

[{"Business Unit":{"code":"BU048","label":"IBM Software"}, "Product":{"code":"SSCVS22","label":"General"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"900","Edition":""}]

Document Information

Modified date:
20 January 2020