Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 4483 invoked from network); 20 Oct 2009 12:12:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 Oct 2009 12:12:57 -0000 Received: (qmail 34113 invoked by uid 500); 20 Oct 2009 12:12:56 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 34037 invoked by uid 500); 20 Oct 2009 12:12:55 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 34026 invoked by uid 99); 20 Oct 2009 12:12:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Oct 2009 12:12:54 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists+1214986160035-208411@n2.nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Oct 2009 12:12:52 +0000 Received: from tervel.nabble.com ([192.168.236.150]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1N0DZn-00066c-8F for users@openjpa.apache.org; Tue, 20 Oct 2009 05:12:31 -0700 Date: Tue, 20 Oct 2009 05:12:31 -0700 (PDT) From: Rohit Kelapure To: users@openjpa.apache.org Message-ID: <1256040751251-3858228.post@n2.nabble.com> Subject: SQLIntegrityConstraintViolationException when running CacheLoadTest MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: Rohit Kelapure Dear All, When executing the openJPA 2.0, org.apache.openjpa.persistence.datacache.CacheLoadTest, the tester thread encounters the following exceptions during insert operations .... java.sql.SQLIntegrityConstraintViolationException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'SQL091019011222610' defined on 'OPENJPA_SEQUENCE_TABLE'. org.apache.openjpa.util.ObjectExistsException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'SQL091019011222610' defined on 'OPENJPA_SEQUENCE_TABLE'. org.apache.openjpa.persistence.EntityExistsException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'SQL091019011222610' defined on 'OPENJPA_SEQUENCE_TABLE'. Is there a way to avoid these exceptions during the transaction commit i.e. can I check for SQLIntegrityConstraint before ending the transaction. Code for insert: private void insert() throws Exception { EntityManager em = emf.createEntityManager(); startTx(em); for (int i = 0; i < (rnd(100)); i++) { em.persist(randomizeBean(rndclass().newInstance())); } endTx(em); endEm(em); } --Thanks, Rohit Kelapure -- View this message in context: http://n2.nabble.com/SQLIntegrityConstraintViolationException-when-running-CacheLoadTest-tp3858228p3858228.html Sent from the OpenJPA Users mailing list archive at Nabble.com.