IBM Support

PH41649: ECLIPSELINK THROWS EXCEPTION FOR PARAMETERS USED IN CRITERIABUILDER UPDATE QUERY

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

  • When executing a CriteriaBuilder Update query containing
    ParameterExpressions, EclipseLink will throw an exception. The
    equivalent JPQL query does not throw an exception.
    
    ´´´
    java.lang.IllegalArgumentException: No parameter with name :
    Parameter[name=null] was found within the query:
    UpdateAllQuery(referenceClass=SimpleEntity ).
     at
    org.eclipse.persistence.internal.jpa.EJBQueryImpl.setParameter(E
    JBQueryImpl.java:548)
     at
    org.eclipse.persistence.internal.jpa.EJBQueryImpl.setParameter(E
    JBQueryImpl.java:1)
    ´´´
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server - Java Persistence API - JPA 2.1 &   *
    *                  EclipseLink                                 *
    ****************************************************************
    * PROBLEM DESCRIPTION: EclipseLink throws an exception for     *
    *                      parameters used in CriteriaBuilder      *
    *                      Update query                            *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    When using parameter markers within CriteriaBuilder UPDATE
    queries, EclipseLink throws an exception.
    Example:
    ´´´
    CriteriaBuilder cb = em.getCriteriaBuilder();
    CriteriaUpdate<SimpleEntity> cquery =
    cb.createCriteriaUpdate(SimpleEntity.class);
    Root<SimpleEntity> root = cquery.from(SimpleEntity.class);
    ParameterExpression<Integer> intValue =
    cb.parameter(Integer.class);
    ParameterExpression<String> strValue =
    cb.parameter(String.class);
    cquery.set(root.get(SimpleEntity_.intVal1), intValue);
    cquery.where(cb.equal(root.get(SimpleEntity_.intVal2),
    strValue));
    query = em.createQuery(cquery);
    query.setParameter(intValue, 9);
    query.setParameter(strValue, "HELLO");
    query.executeUpdate();
    ´´´
    Exception:
    ´´´
    java.lang.IllegalArgumentException: No parameter with name :
    Parameter[name=null] was found within the query:
    UpdateAllQuery(referenceClass=SimpleEntity ).
    at
    org.eclipse.persistence.internal.jpa.EJBQueryImpl.setParameter(E
    JBQueryImpl.java:548)
    at
    org.eclipse.persistence.internal.jpa.EJBQueryImpl.setParameter(E
    JBQueryImpl.java:1)
    ´´´
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    PH41649

  • 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-10-28

  • Closed date

    2021-12-20

  • Last modified date

    2021-12-20

  • 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

[{"Line of Business":{"code":"LOB45","label":"Automation"},"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"}]

Document Information

Modified date:
21 December 2021