IBM Support

PH13805: UNIDIRECTIONAL ONETOMANY MAPPING INSERTS WITH MULTIPLE FOREIGN KEY REFERENCES

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • If an entity relationship has a OneToMany mapping with a
    JoinColumn to an existing foreign key mapping, EclipseLink will
    add an additional reference to that column in the INSERT
    statement.
    
    Example:
    
    @Entity
        public class Post {
           @Id private Long id;
           @OneToMany @JoinColumn(name = "POST_FK",
            referencedColumnName = "id", nullable = false)
           private List<Comment> comments;
        }
        @Entity
        public class Comment {
           @Id private Long id;
           @Column(name = "POST_FK", nullable = false)  private long
                          idA;
        }
    
    
    In this example, since "POST_FK" is an existing mapping declared
    in Comment entity, then EclipseLink will add the column to the
    INSERT statement twice. This causes the following exception to
    be thrown:
    
    `java.sql.SQLSyntaxErrorException: Column name 'POST_FK'
    appears more than once times in the column list of an INSERT
    statement.`
    

Local fix

  • N/A
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server - Java Persistence API - JPA 2.1 &   *
    *                  EclipseLink                                 *
    ****************************************************************
    * PROBLEM DESCRIPTION: EclipseLink INSERTs for                 *
    *                      Unidirectional, OneToMany mapping       *
    *                      contain multiple FK references          *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    This is a regression fix for PH02992 that delivered
    Unidirectional, OneToMany relationship support for non-nullable
    FK. Adding that support revealed an existing bug that was not
    previously being encountered with this mapping.
    Example exception:
    &#180;&#180;&#180;
    Call: INSERT INTO VEHICLE (SALES_ID, AMOUNT, PERCENTAGE,
    VERSION, SALES_ID, TYPE) VALUES (?, ?, ?, ?, ?, ?)
    bind => [74cceb63-46a5-4871-b171-4ecf67fd5fd7, 4789.915966,
    19, 1, 74cceb63-46a5-4871-b171-4ecf67fd5fd7, VAT]
    Caused by org.eclipse.persistence.exceptions.DatabaseException
    :
    Internal Exception: java.sql.SQLSyntaxErrorException:
    ORA-00957: duplicate column name
    &#180;&#180;&#180;
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    PH13805

  • Reported component name

    WEBS APP SERV N

  • Reported component ID

    5724H8800

  • Reported release

    900

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2019-06-27

  • Closed date

    2019-11-25

  • Last modified date

    2019-11-25

  • 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

  • R900 PSY

       UP

[{"Line of Business":{"code":"LOB36","label":"IBM Automation"},"Business Unit":{"code":"BU053","label":"Cloud \u0026 Data Platform"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"900"}]

Document Information

Modified date:
15 September 2021