IBM Support

PM95693: OPENJPA VERSION INCREMENTING STRATEGY BEHAVES DIFFERENTLY ON OPENJPA 1.2.3

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • The difference shows up when list operations are run on a
    list of children in a one-to-many parent-child relation.
    
    When the parent or a child entity is modified only the parent
    or child version is incremented resulting in the correct
    opertation. The problem is encountered when a  child is added
    or removed from the list and the parent is merged:
    "entityManager.merge(parent)", the version fields of the parent
    and ALL children are incremented using OpenJPA 1.2.3. The
    parent version is incremented only using OpenJPA 2.2.1. This
    results in optimistic lock exceptions in the customer
    application.
    
    To circumvent the problem specify this openjpa property.
    openjpa.DetachState=loaded(DetachedStateField=true)
    
    This property is to be added in the persistence.xml or other
    valid environment to enable this property.
    

Local fix

  • n/a
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server V7.0.0 who make use of the JPA       *
    *                  @PreUpdate and @PrePersist                  *
    *                  (@EntityListeners) annotations.             *
    ****************************************************************
    * PROBLEM DESCRIPTION: Un-scheduled pre/postUpdate callbacks   *
    *                      from persist.                           *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    When there exists a one-to-many Parent-Child releationship
    where an @EntityListeners is defined, there exists the
    potential for the @PreUpdate and @PrePersist methods to be
    called on the Child when the Parent is updated.  The Child
    doesn't need to be updated when the Parent is updated.
    

Problem conclusion

  • With this fix, code has been added to OpenJPA to ensure
    methods annotated with @PreUpdate and @PrePersist are invoked
    at the correct time.  In addition to this fix, the following
    property may be needed:
    
    openjpa.DetachState=loaded(DetachedStateField=true)
    
    The fix for this APAR is currently targeted for
    inclusion in Service Level (Fix Pack) 7.0.0.31 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

    PM95693

  • Reported component name

    WEBS APP SERV N

  • Reported component ID

    5724H8800

  • Reported release

    700

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-08-23

  • Closed date

    2013-08-29

  • Last modified date

    2013-08-29

  • 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

  • R700 PSY

       UP



Document information

More support for: WebSphere Application Server
General

Software version: 7.0

Reference #: PM95693

Modified date: 29 August 2013