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.3 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
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
LIBERTY PROFILE
Fixed component ID
5724J0814
Applicable component levels
[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"CD0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]
Document Information
Modified date:
03 February 2020