openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim McConnell (JIRA)" <>
Subject [jira] Commented: (OPENJPA-466) Primary key constraint violated using (Oracle) sequence to generate ID in multithreaded app
Date Thu, 12 Feb 2009 00:51:59 GMT


Tim McConnell commented on OPENJPA-466:

Hi again Joe, I can now replicate the problem on both postgresql and oracle databases. Here
is the error I get on oracle. Now, I will determine the cause for each. Thanks for your help.....

Caused by: <openjpa-2.0.0-SNAPSHOT-r422266:743437M nonfatal general error> org.apache.openjpa.persistence.PersistenceException:
ORA-00001: unique constraint (SYSTEM.SYS_C004001) violated
 {prepstmnt 30673895 INSERT INTO ENTITY_PERSON (id, firstName, lastName) VALUES (?, ?, ?)
[params=(int) 15662, (String) First_name_1011, (String) Last_name_1011]} [code=1, state=23000]
FailedObject: org.apache.openjpa.persistence.hightps.sequence.EntityPerson@114c8b6
	at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(
	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(
	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(
	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(
	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(
	at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.batchOrExecuteRow(
	at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(
	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(
	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(
	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(
	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(
	at org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(
	at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(
	at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(
	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(
	at org.apache.openjpa.kernel.DelegatingStoreManager.flush(
	... 15 more

> Primary key constraint violated using (Oracle) sequence to generate ID in multithreaded
> -------------------------------------------------------------------------------------------
>                 Key: OPENJPA-466
>                 URL:
>             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
> 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:
> 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.

View raw message