IBM Support

PH06475: OVERRIDE ECLIPSELINK JDBC PARAMETER BINDING

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

  • 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 &#180;eclipselink.jdbc.force-bind-parameters&#180; 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

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