IBM Support

PM89305: MAPSID IN A CHILD ENTITY TO A PARENT ENTITY USING AUTO-ASSIGNED IDENTITY FAILS WITH DUPLICTE INSERT SQL.

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When inserting ObjectA in to a database with ObjectB attached
    to it, ObjectA is inserted twice resulting in a sqlstate 23505
    constraint violation.
    
    The Primary Key of ObjectC is autogenerated and is used in
    ObjectA as the Primary Key.  It is also used as part of
    ObjectB's Primary Key.
    
    In testing, if you use the same setup while replacing the
    combined Primary Key of ObjectB with a single Primary Key, the
    test case runs without errors.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server V8.0.0, V8.5.0, and V8.5.5 who make  *
    *                  use of MapsID and auto-generated identity.  *
    ****************************************************************
    * PROBLEM DESCRIPTION: MapsId in a Child entity to a Parent    *
    *                      entity using auto-assigned identity     *
    *                      fails with duplicte INSERT SQL.         *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    A MapsId annotation in entity C (child) annotates a field p of
    type P (parent). P uses auto-generated identity.
    P-C is a bidirectional parent-child relationship.
    During flush sequence, a row is created for P and flushed for
    the database to assign an identity. When C is flushed, it
    wrongly creates a row for P again while handling the field p
    that points to parent.
    This results in a commit which fails with a
    DuplicateKeyException on P's table.
    

Problem conclusion

  • With this fix, code has been added to OpenJPA to properly
    generate SQL when handling a Parent/Child relationship
    which uses MapsID and auto-generated identity.
    
    The fix for this APAR is currently targeted for
    inclusion in Service Levels (Fix Packs) 8.0.0.7 and
    8.5.5.1 of WebSphere Application Server versions 8.0.0 and
    8.5.5.
    
    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

    PM89305

  • 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-05-17

  • Closed date

    2013-07-10

  • Last modified date

    2013-07-22

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

    PM87616

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

    PM93342

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:
12 January 2022