APAR status
Closed as program error.
Error description
Customer with a JPA 2.1 application found that their JPQL queries had unbound parameters if they contained arithmetic expressions. For instance, this query with its use of "abs()": UPDATE SimpleEntity SET content2 = ?, content1 = ? WHERE (id = abs(?)) They were able to work around this by using the org.eclipse.persistence.config.QueryHints.BIND_PARAMETERS query hint, but did not feel this should be mandatory.
Local fix
Use the org.eclipse.persistence.config.QueryHints.BIND_PARAMETERS query hint for queries that contain arithmetic expressions
Problem summary
**************************************************************** * USERS AFFECTED: All users of IBM WebSphere Application * * Server Liberty - Java Persistence APA - * * JPA * * 2.1 & EclipseLink * **************************************************************** * PROBLEM DESCRIPTION: EclipseLink persistent property * * 'eclipselink.jdbc.bind-parameters' * * does * * not override the DatabasePlatform * **************************************************************** * RECOMMENDATION: * **************************************************************** EclipseLink's DB2Platform disables parameter binding for function expressions by default. This APAR adds a new persistence property so that we can override that behavior if needed without having to set a QueryHint for every query. One thing to note is that a similar property already exists: 'eclipselink.jdbc.bind-parameters'. However, this does not work for this use case. The default value for 'eclipselink.jdbc.bind-parameters' is already 'true'. Passing in a value of 'true' to this persistence property has no change in behavior and should not be used to force parameter binding to occur. The new persistence property is this: <property name="eclipselink.jdbc.force-bind-parameters" value="true"/> Property ´eclipselink.jdbc.force-bind-parameters´ enables parameter binding in the creation of JDBC prepared statements. Some EclipseLink database platforms (in this case DB2) disable parameter binding on certain functions and relations. This property allows the user to force parameter binding to not be disabled.
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=542491 This fix is currently targeted for WebSphere Application Server 9.0.0.11 and WebSphere Liberty 19.0.0.2. Please refer to the Recommended Updates page for delivery information: http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
Temporary fix
Calling ".setHint("eclipselink.jdbc.bind-parameters", true);" on the query will also override the DatabasePlatform
Comments
APAR Information
APAR number
PH06475
Reported component name
LIBERTY PROF -
Reported component ID
5655W6514
Reported release
CD0
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2018-12-13
Closed date
2019-01-16
Last modified date
2019-01-31
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 PROF -
Fixed component ID
5655W6514
Applicable component levels
RCD0 PSY
UP
[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SG19M","label":"APARs - z\/OS environment"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"CD0","Edition":"","Line of Business":{"code":"","label":""}}]
Document Information
Modified date:
31 January 2019