IBM Support

PH10848: RETURN NULL FOR AGGREGATE FUNCTIONS WITH PRIMITIVE TYPE

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

  • According to the JPA specification, section 4.8.5, the
    result of
    an aggregate function, with no values, should be NULL. While
    EclipseLink returns the correct value of NULL if the state
    field
    is a numeric wrapper (java.lang.*), EclipseLink returns a
    result of `0` if the state field is of primitive type.
    

Local fix

  • No
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server - Java Persistence API - JPA 2.1 &   *
    *                  EclipseLink                                 *
    ****************************************************************
    * PROBLEM DESCRIPTION: EclipseLink returns a result of '0' for *
    *                      MAX/MIN aggregate functions instead of  *
    *                      'NULL' as described in the JPA          *
    *                      specification                           *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    According to the JPA 2.1 specification; Section 4.8.5: Aggregate
    Functions
        "If SUM, AVG, MAX, or MIN is used, and there are no values
    to which the aggregate function can be applied, the result of
    the aggregate function is NULL."
    
    However, EclipseLink changes the result of the aggregate query
    to return a value of 0 when the Entity field is a primitive
    type, regardless if there are values to which the aggregate
    function applies.
    

Problem conclusion

  • The fix for this APAR changes the EclipseLink implementation and
    involves an update to the thirdparty source. See
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=421056
    
    The existing behavior of returning 0 will remain the default,
    however a new persistence property is being introduced by this
    APAR that can be set as follows to obtain the behavior of
    returning NULL, as described in the spec:
    
    <property name="eclipselink.allow-null-max-min" value="true"/>
    
    This fix is currently targeted for WebSphere Application Server
    9.0.5.1, 8.5.5.16, and WebSphere Liberty 19.0.0.6.  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

    PH10848

  • Reported component name

    LIBERTY PROFILE

  • Reported component ID

    5724J0814

  • Reported release

    CD0

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2019-04-11

  • Closed date

    2019-07-01

  • Last modified date

    2019-07-01

  • 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

    LIBERTY PROFILE

  • Fixed component ID

    5724J0814

Applicable component levels



Document information

More support for: WebSphere Application Server

Software version: CD0

Reference #: PH10848

Modified date: 01 July 2019