IBM Support

PM87331: ENTITIES WITH VERSION FIELD SET TO NULL CAN BE MERGED WHEN EXTENDING A MAPPED SUPERCLASS

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When the EntityManager.merge operation is applied to a class
    extending a mapped superclass, an exception is not thrown.
    
    For example, a testSimple() method persists a new instance of
    class Simple and subsequently merges another new instance of
    class Simple under the same id.  Simple extends MapSup, which
    is a mapped superclass.  This should fail, generating an
    exception similar to the following...
    
    Caused by: <openjpa-2.0.2-SNAPSHOT-r422266:1415037M fatal store
    error> org.apache.openjpa.persistence.EntityExistsException:
    
    FailedObject: test.ibm.Simple@4eeb4eeb
    at
    org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImp
    l.java:2305)
    at
    org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2142)
    
    Instead, no exception is thrown and the merge is successful.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server V8.0 and V8.5 who make use of a      *
    *                  MappedSuperClass without a declared         *
    *                  identity field (the derived classes         *
    *                  declare an @Id field).                      *
    ****************************************************************
    * PROBLEM DESCRIPTION: MappedSuperClass without an @Id         *
    *                      causes wrong identity type for the      *
    *                      inherited types.                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    A MappedSuperClass without a declared identity field can cause
    the derived classes that have decalred an @Id field to
    incorrectly use the wrong identity type because the identity
    type of its superclass is unknown.  This leads to the derived
    type to use the default identity type.  As an exmaple of this
    case, take the following very simple MappedSuperclass:
    @MappedSuperclass
    public class MappedSuperWithoutId {
    private String description;
    public String getDesc() {
    return description;
    }
    public void setDesc(String desc) {
    this.description = desc;
    }
    }
    With the above MappedSuperclass, take the following JPA Entity:
    @Entity
    public class DerivedEntityFromMappedSuperWithoutId extends
    MappedSuperWithoutId {
    @Id
    private long id;
    

Problem conclusion

  • With this fix, code has been added to OpenJPA to properly
    handle an identity field declared in a derived class, rather
    than the mapped super class.
    
    The fix for this APAR is currently targeted for inclusion in
    fix packs 8.0.0.7 and 8.5.5.1. 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

    PM87331

  • Reported component name

    WEBSPHERE APP S

  • Reported component ID

    5724J0800

  • Reported release

    800

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-04-18

  • Closed date

    2013-05-01

  • Last modified date

    2013-05-01

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

    PM81331

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

    PM93344

Fix information

  • Fixed component name

    WEBSPHERE APP S

  • Fixed component ID

    5724J0800

Applicable component levels

  • R800 PSY

       UP

  • R850 PSY

       UP

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"8.0","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
11 January 2022