IBM Support

PH49962: ECLIPSELINK THROWS CLASSCASTEXCEPTION DURING UPDATE WITH IDENTITY GENERATION

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 

APAR status

  • Closed as program error.

Error description

  • EclipseLink throws a ClassCastException for applications that
    enable generated keys, use identity generation, and have
    @ManyToOne relationships with themselves
    
    Exception
    ```
    Caused by: java.lang.ClassCastException:
    org.eclipse.persistence.queries.SQLCall incompatible with
    java.lang.Integer
    	at
    org.eclipse.persistence.internal.queries.DatasourceCallQueryMech
    anism.updateObject(DatasourceCallQueryMechanism.java:905)
    	at
    org.eclipse.persistence.internal.queries.StatementQueryMechanism
    .updateObject(StatementQueryMechanism.java:462)
    	at
    org.eclipse.persistence.internal.queries.CallQueryMechanism.upda
    teForeignKeyFieldAfterInsert(CallQueryMechanism.java:435)
    	at
    org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.
    updateForeignKeyFieldAfterInsert(DatabaseQueryMechanism.java:795
    )
    	at
    org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.
    insertObjectForWrite(DatabaseQueryMechanism.java:471)
    	at
    org.eclipse.persistence.queries.InsertObjectQuery.executeCommit(
    InsertObjectQuery.java:86)
    	at
    org.eclipse.persistence.queries.InsertObjectQuery.executeCommitW
    ithChangeSet(InsertObjectQuery.java:97)
    	at
    org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.
    executeWriteWithChangeSet(DatabaseQueryMechanism.java:326)
    	at
    org.eclipse.persistence.queries.WriteObjectQuery.executeDatabase
    Query(WriteObjectQuery.java:61)
    	at
    org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQu
    ery.java:913)
    ```
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server - Java Persistence API - JPA 2.1 &   *
    *                  EclipseLink                                 *
    ****************************************************************
    * PROBLEM DESCRIPTION: EclipseLink throws a                    *
    *                      ClassCastException when updating        *
    *                      entities with identity generation       *
    *                      This is a regression fix for PH45432    *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    APAR PH45432 delivered persistence property
    <property
    name="eclipselink.target-database-properties"
    value="supportsReturnGeneratedKeys=true" />
    With this property set, if the Entity class has a @ManyToOne
    reference to itself and uses Identity Generation, EclipseLink
    will throw a ClassNotFoundException.
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    PH49962

  • Reported component name

    WEBSPHERE APP S

  • Reported component ID

    5724J0800

  • Reported release

    900

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2022-10-03

  • Closed date

    2023-04-14

  • Last modified date

    2023-04-14

  • 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

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

Document Information

Modified date:
15 April 2023