IBM Support

PM74489: UPDATE BY QUERY FAILS ON ENTITIES USING TIMESTAMPED VERSION FIELD

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • Update by query fails when an entity is using Timestamped
    version field
    

Local fix

  • N/A
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server V7.0.0 who make use of a Java        *
    *                  Persistence API (JPA) version field of      *
    *                  Timestamp type.                             *
    ****************************************************************
    * PROBLEM DESCRIPTION: An update query of a JPA Version        *
    *                      field of type Timestamp may fail.       *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    Take the following JPA Entity definition:
    @Entity
    public class TimestampedEntity {
    @Id
    @GeneratedValue
    private long id;
    private String name;
    @Version
    private Timestamp version;
    As can be seen a version (@Version) field is defined with a
    type of Timestamp.  When this entity is updated, the update
    may fail.  For example, the following update query will fail:
    String jpql = "UPDATE TimestampedEntity t SET t.name=:newname
    WHERE t.name=:oldname";
    em.createQuery(jpql).setParameter("newname", "Updated")
    .setParameter("oldname", "Original").executeUpdate();
    

Problem conclusion

  • With this fix, code has been added to OpenJPA to ensure that a
    Timestamp version field is properly handled when an attempt is
    made to update the corresponding entity.
    
    The fix for this APAR is currently targeted for
    inclusion in Service Level (Fix Pack) 7.0.0.27 of WebSphere
    Application Server version 7.0.0.
    
    Please refer to the recommended updates page for delivery
    information:
    http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
    

Temporary fix

Comments

APAR Information

  • APAR number

    PM74489

  • Reported component name

    WEBSPHERE APP S

  • Reported component ID

    5724J0800

  • Reported release

    700

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2012-10-05

  • Closed date

    2012-10-15

  • Last modified date

    2012-11-27

  • APAR is sysrouted FROM one or more of the following:

    PM73302

  • 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

  • R700 PSY

       UP



Document information

More support for: WebSphere Application Server
General

Software version: 7.0

Reference #: PM74489

Modified date: 27 November 2012