APAR status
Closed as program error.
Error description
EclipseLink throws an exception for CriteriaBuilder queries that contain parameter expressions in the SELECT clause. However, EclipseLink does not throw an exception for JPQL queries that contain parameters in the SELECT clause and instead execute without issue. This fix is to allow EclipseLink's CriteriaBuilder queries to allow parameters in SELECT clause the same as the JPQL implementation. Exception example: ´´´ org.eclipse.persistence.exceptions.QueryException Exception Description: The parameter name [stringValue] in the query's selection criteria does not match any parameter name defined in the query. ´´´
Local fix
Problem summary
**************************************************************** * USERS AFFECTED: All users of IBM WebSphere Application * * Server - Java Persistence API - JPA 2.1 & * * EclipseLink * **************************************************************** * PROBLEM DESCRIPTION: Add support for input parameters * * within EclipseLinks CriteriaBuilder * * implementation * **************************************************************** * RECOMMENDATION: * **************************************************************** Example: ´´´ CriteriaBuilder cb = em.getCriteriaBuilder(); cquery = cb.createQuery(Object[].class); root = cquery.from(SimpleEntity.class); cquery.multiselect(root.get(SimpleEntity_.strVal1), cb.parameter(String.class, "stringValue")); cquery.where(cb.equal(root.get(SimpleEntity_.intVal1), cb.parameter(Long.class, "idValue"))); query = em.createQuery(cquery); query.setParameter("stringValue", "HELLO"); query.setParameter("idValue", 4); query.getResultList(); ´´´ Example exception: ´´´ org.eclipse.persistence.exceptions.QueryException Exception Description: The parameter name [stringValue] in the query's selection criteria does not match any parameter name defined in the query. Query: ReportQuery(referenceClass=SimpleEntity sql="SELECT STRVAL1, ? FROM SIMPLEENTITY WHERE (INTVAL1 = ?)") at org.eclipse.persistence.exceptions.QueryException.parameterNameM ismatch(QueryException.java:1098) at org.eclipse.persistence.internal.expressions.ParameterExpression .getValue(ParameterExpression.java:290) at org.eclipse.persistence.internal.databaseaccess.DatabaseCall.tra nslate(DatabaseCall.java:1147) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMech anism.executeCall(DatasourceCallQueryMechanism.java:276) ´´´
Problem conclusion
The fix for this APAR changes the EclipseLink implementation and involves an update to the third-party source. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=571794 This fix is currently targeted for WebSphere Application Server 9.0.5.9. For more information, see 'Recommended Updates for WebSphere Application Server': https://www.ibm.com/support/pages/node/715553
Temporary fix
Comments
APAR Information
APAR number
PH36833
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
2021-04-29
Closed date
2021-07-07
Last modified date
2021-07-07
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
R900 PSY
UP
[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"9.0","Line of Business":{"code":"LOB45","label":"Automation"}}]
Document Information
Modified date:
01 November 2021