IBM Support

PM60051: TRAVERSAL OF A ONETOMANY RELATIONSHIP RETURNS AN EMPTY LIST WHEN INHERITANCETYPE.JOINED OR SINGLE_TABLE IS USED.

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • OpenJPA generate incorrect SQL.  Bidirectional OneToMany
    relations returns an emplty list when traversing
    the OneToMany side of the relations. When traversing the
    ManyToOne side of the realtison, all works well.
    
    [1/25/12 11:12:37:871 EST] 000000cd jdbc_SQL      3
    openjpa.jdbc.SQL:
    Trace: <t 64607553, conn 65859648> executing prepstmnt 65860094
    SELECT
    t1.id, t0.id, t2.id, t3.id, t1.name FROM UML.UMLType t0 INNER
    JOIN
    UML.UMLNamed t1 ON t0.id = t1.id LEFT OUTER JOIN UML.UMLClass t2
    ON
    t0.id = t2.id LEFT OUTER JOIN UML.UMLPrimitiveType t3 ON t0.id =
    t3.id
    WHERE t0.OWNERPACKAGE_ID = ?AND t2.id IS NULL AND t3.id IS NULL
    [params=?]
    

Local fix

  • N/A
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server V8.0.0 who make use of               *
    *                  bidirectional OneToMany relationships in    *
    *                  their JPA Entities.                         *
    ****************************************************************
    * PROBLEM DESCRIPTION: Traversal of a OneToMany relationship   *
    *                      returns an empty list when              *
    *                      InheritanceType.JOINED or               *
    *                      SINGLE_TABLE is used.                   *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    Their exsists the potential for SQL to be incorrectly
    generated when InheritanceType.JOINED or
    InheritanceType.SINGLE_TABLE is used.  The issue occurs when a
    parent class defined with
    @Inheritance(strategy=InheritanceType.JOINED) and a
    subclasses in the hierarchy contains a (bidirectional)
    OneToMany relationship. When traversing the ManyToOne side of
    the relations, all works well. But when traversing the
    OneToMany side an empty list is returned.  It was observed
    that OpenJPA generated incorrect SQL, as follows:
    SELECT t1.id, t0.id, t2.id, t3.id, t1.name FROM UMLType t0,
    UMLNamed t1, UMLClass t2, UMLPrimitiveType t3 WHERE
    t0.OWNERPACKAGE_ID = ? AND t2.id IS NULL AND t3.id IS NULL AND
    t0.id = t1.id AND t0.id = t2.id(+) AND t0.id = t3.id(+)
    Note that the 't2.id IS NULL AND t3.id IS NULL' is suspect.
    

Problem conclusion

  • With this fix code has been added to OpenJPA to ensure that
    proper SQL is generated when a parent entity uses
    InheritanceType.JOINED or InheritanceType.SINGLE_TABLE.
    
    The fix for this APAR is currently targeted for
    inclusion in Service Level (Fix Pack) 8.0.0.5 of WebSphere
    Application Server version 8.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

    PM60051

  • 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

    2012-03-08

  • Closed date

    2012-05-25

  • Last modified date

    2012-07-17

  • 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

    WEBSPHERE APP S

  • Fixed component ID

    5724J0800

Applicable component levels

  • R800 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:
28 October 2021