Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 54061 invoked from network); 22 Jun 2009 18:54:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Jun 2009 18:54:20 -0000 Received: (qmail 13953 invoked by uid 500); 22 Jun 2009 18:54:31 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 13896 invoked by uid 500); 22 Jun 2009 18:54:31 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 13886 invoked by uid 99); 22 Jun 2009 18:54:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jun 2009 18:54:31 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jun 2009 18:54:28 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id BCA8C234C004 for ; Mon, 22 Jun 2009 11:54:07 -0700 (PDT) Message-ID: <1701571436.1245696847757.JavaMail.jira@brutus> Date: Mon, 22 Jun 2009 11:54:07 -0700 (PDT) From: "Milosz Tylenda (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Commented: (OPENJPA-466) Primary key constraint violated using (Oracle) sequence to generate ID in multithreaded app In-Reply-To: <22223569.1197513643017.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-466?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722759#action_12722759 ] Milosz Tylenda commented on OPENJPA-466: ---------------------------------------- Maybe some volounteer could try reproducing this and if reproduced, try with volatile.patch. If not, I will restore the synchronization around PreparedStatement since I am not able to reproduce the issue with my system (Pentium M). > 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: Milosz Tylenda > Priority: Blocker > Fix For: 1.3.0, 2.0.0-M2 > > Attachments: OPENJPA-466.patch, OPENJPA-466.patch, volatile.patch > > > 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.