IBM Support

PK94754: ISSUE WITH DUPLICATED DATABASE PRIMARY KEY VIOLATIONS.

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Getting the following stack below:
    
    [7/07/09 12:16:09:375 CEST] 0000003d ExceptionUtil E
    CNTR0020E:
    EJB has generated a not expected exception (not declared) when
    invoked method "<methodName>" at bean
    "BeanId(nameOfEAR#naming.jar#CONStressJPA, null)". Exception
    data : javax.ejb.EJBTransactionRolledbackException: nested
    exception is: javax.ejb.EJBException: See nested exception;
    nested
    exception is: com.name.name2.sscc.exceptions.BaseException:
    ORA-00001:
    unique restriction (SYSTEM.SYS_someName) violated
    javax.ejb.EJBException: See nested exception; nested exception
    is:
    com.<name>.<name2>.exceptions.BaseException: ORA-00001: unique
    restriction
    (SYSTEM.SYS_someName) violated
    com.<name>.<name2>.exceptions.BaseException: ORA-00001: unique
    restriction
    (SYSTEM.SYS_someName) violada
    
    
    Caused by: <openjpa-1.0.3-SNAPSHOT-r420667:649224 fatal general
    error>
    org.apache.openjpa.persistence.PersistenceException: ORA-00001:
    unique restriction (SYSTEM.SYS_someName) violated
    FailedObject: prepstmnt 875443246 INSERT INTO
    <table_name> <column names> VALUES (?, ?, ?, ?, ?)
    [org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedS
    tatement]
     at
    org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDic
    tionary.jav
    a:3949)
     at
    org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions
    .java:97)
     at
    org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions
    .java:67)
    

Local fix

  • candidate to be fixed in next release
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  Users of IBM WebSphere Application Server   *
    *                  that use Open JPA with an Oracle or         *
    *                  PostgreSQL Database and multi threaded      *
    *                  applications.                               *
    ****************************************************************
    * PROBLEM DESCRIPTION: Primary key constraint violated using   *
    *                      an Oracle or PostgreSQL sequence to     *
    *                      generate ID in multithreaded            *
    *                      application.                            *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    In a multi threaded application, sometimes the threads can try
    to use the same generated id for entity creation.
    

Problem conclusion

  • Two pieces of code have been modified to fix this problem.
    The first was to synchronize a call to run a query in
    NativeJDBCSeq.java so that only one thread would be able to
    generate an id at a time.  The second was to alter
    AlterJDBCSeq.java to break a call to nextInternal into
    multiple steps so that a variable would only be set if the
    results from nextInternal are good.
    
    The fix for this APAR is currently targeted for inclusion in
    fix pack 6.1.0.29.  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

    PK94754

  • Reported component name

    WAS EJB3 FEATUR

  • Reported component ID

    5724J0851

  • Reported release

    610

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2009-08-26

  • Closed date

    2009-09-11

  • Last modified date

    2009-09-11

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

    PK90928

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

Fix information

  • Fixed component name

    WAS EJB3 FEATUR

  • Fixed component ID

    5724J0851

Applicable component levels

  • R610 PSY

       UP

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

Document Information

Modified date:
10 February 2022