IBM Support

PI97945: ECLIPSELINK JPA PROVIDER DOES NOT UPDATE VERSON COLUMN AS A BULK UPDATE PARAMETER

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

  • A bulk update query is expected to be able to update the
    version column as a parameter (JPA 2.1 Spec section 4.10), but
    the query parameter's value is ignored and instead a provider
    generated value is used.
    

Local fix

  • rename the field from "updatetimestamp" to "version", then it
    actually works as expected
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server Liberty - Java Persistence APA -     *
    *                  JPA 2.1 & EclipseLink                       *
    ****************************************************************
    * PROBLEM DESCRIPTION: EclipseLink does not update the         *
    *                      version column value for specific       *
    *                      parameter names. This only occurs       *
    *                      when executing in batch.                *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    The following sample code demonstrates how an application
    would encounter this exception:
    @Entity
    public class TemporalVersionedEntity {
    @Id private long id;
    @Version private java.sql.Timestamp updatetimestamp;
    ...
    }
    Test:
    private final static String qStr1 = "UPDATE
    TemporalVersionedEntity SET updatetimestamp = ?3 " +
    "WHERE id = ?1 AND updatetimestamp = ?2";
    em.getTransaction().begin();
    final Query q = em.createQuery(qStr1);
    q.setParameter(1, theId);
    q.setParameter(2, theOldTimestamp);
    q.setParameter(3, new
    java.sql.Timestamp(System.currentTimeMillis());
    final int count = q.executeUpdate();
    In this test scenario, the UPDATE block that targets the
    version field is ignored, and instead replaces the Parameter
    with a Constant (generated at the time the query is generated,
    which then gets cached and fouls up successive executions of
    the same query once it gets into the query cache, too.) When
    this happens, the parameter passed into the query is ignored.
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    PI97945

  • Reported component name

    WEBS APP SERV N

  • Reported component ID

    5724H8800

  • Reported release

    900

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2018-05-14

  • Closed date

    2018-08-06

  • Last modified date

    2018-08-06

  • 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

    WEBS APP SERV N

  • Fixed component ID

    5724H8800

Applicable component levels



Document information

More support for: WebSphere Application Server
General

Software version: 900

Reference #: PI97945

Modified date: 06 August 2018


Translate this page: