openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Pullen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENJPA-466) Primary key constraint violated using (Oracle) sequence to generate ID in multithreaded app
Date Wed, 11 Feb 2009 11:46:59 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-466?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12672606#action_12672606
] 

Joe Pullen commented on OPENJPA-466:
------------------------------------

Hi Tim,

Looks similar to mine from oracle.

]]></stack><cause><stack><![CDATA[      <openjpa-1.2.0-r422266:683325
nonfatal general error> org.apache.openjpa.persistence.PersistenceException: ORA-00001:
unique constraint (P
OR.DSTA_PK) violated
 {prepstmnt 97 INSERT INTO DIA_STATUSES (DSTA_ID, APPLICATION_ID, COMPONENT_NAME, STATUS_LEVEL,
REFERENCE_ID, SOFTWARE_VERSION, TIME_STAMP, VERSION, DATE_CREATED, CREATED_BY, DAT
E_MODIFIED, MODIFIED_BY, PPPC_ID, PPRC_ID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?) [params=(long) 230503, (String) JTX, (String) input, (short) 1, (null) null, (String)
 19-60-08, (Timestamp) 2009-02-10 17:15:05.49, (int) 1, (Timestamp) 2009-02-10 17:15:05.493,
(String) weblogic, (Timestamp) 2009-02-10 17:15:05.493, (String) weblogic, (null) nul
l, (null) null]} [code=1, state=23000]
FailedObject: com.csg.cs.pay.process.diag.domain.Status@17b05c9
        at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4238)
        at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4203)
        at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
        at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:72)
        at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:131)
        at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:89)
        at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:72)
        at org.apache.openjpa.jdbc.kernel.OperationOrderUpdateManager.flushPrimaryRow(OperationOrderUpdateManager.java:203)
        at org.apache.openjpa.jdbc.kernel.OperationOrderUpdateManager.flush(OperationOrderUpdateManager.java:89)
        at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:89)
        at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
        at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:655)
    

> Primary key constraint violated using (Oracle) sequence to generate ID in multithreaded
app
> -------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-466
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-466
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 1.0.0, 1.0.1, 1.1.0, 1.2.0
>         Environment: OpenJPA 1.0.0 (also tried 1.0.1 and 1.1.0-SNAPSHOT)
> Oracle XE 10g (JDBC driver 10.2.0.3.0)
> Windows XP Pro
>            Reporter: Frank Le
>            Assignee: Tim McConnell
>            Priority: Blocker
>
> Here's how I annotate the ID:
>     @Id
>     @SequenceGenerator(name = "FooSeq", sequenceName = "seq_foo", allocationSize = 20)
>     @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "FooSeq")
>     private Long id;
> Here's how I create the (Oracle) sequence:
> CREATE SEQUENCE seq_foo START WITH 1 INCREMENT BY 1;
> I get a primary key unique constraint violated in a multithreaded app i.e. it doesn't
happen in single-threaded!
> You can simply reproduce this error by either create blocking queue or blocking thread
pool say size 5 to insert 10000+ object.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message