Return-Path: X-Original-To: apmail-openjpa-users-archive@minotaur.apache.org Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E9108D7A8 for ; Thu, 27 Sep 2012 20:55:33 +0000 (UTC) Received: (qmail 97570 invoked by uid 500); 27 Sep 2012 20:55:33 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 97529 invoked by uid 500); 27 Sep 2012 20:55:33 -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 97518 invoked by uid 99); 27 Sep 2012 20:55:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Sep 2012 20:55:33 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of curtisr7@gmail.com designates 209.85.223.174 as permitted sender) Received: from [209.85.223.174] (HELO mail-ie0-f174.google.com) (209.85.223.174) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Sep 2012 20:55:25 +0000 Received: by ieak13 with SMTP id k13so6255753iea.33 for ; Thu, 27 Sep 2012 13:55:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ZZShkigRZg98ESU5ZDmuhNYVFjlyiFAvu3foL0pb/ic=; b=bFUIZMLg9Gyr7y4qpFr8U0oi0sqB/BpDEtQ6naCWrrcTpKei86XiSsPaDOo6o5yinB jQmUnF5Q5f7fvPjsJCAxROv/LoGTVyYvcbkPl8kAA30dk+edOqosdOuyUtQhGhaxfqZE i6J20wyi97WemWv+2ys8KZX+y6he4jfhgJLdF3S/GI0vYLV1SfGjrH+az2sugRvvxihy bCcS/uXrfWY3UwpNOMWME+K0fP3NOZn/ayBfL5i29T2q7XTXHEH10R9jnDnXF00hq67E 7wEX7c1rUp1kf+iIomEpHkyo8XZcZM5wZlsEmBU4Vd3ohEzUA/GdiZGyotVveOpyP0gw XqDg== MIME-Version: 1.0 Received: by 10.50.57.234 with SMTP id l10mr11801454igq.18.1348779304250; Thu, 27 Sep 2012 13:55:04 -0700 (PDT) Received: by 10.64.33.148 with HTTP; Thu, 27 Sep 2012 13:55:04 -0700 (PDT) In-Reply-To: <1348777756492-7581248.post@n2.nabble.com> References: <1345667358281-7580917.post@n2.nabble.com> <1348680192631-7581226.post@n2.nabble.com> <1348754448750-7581235.post@n2.nabble.com> <1348755214506-7581237.post@n2.nabble.com> <1348777235595-7581246.post@n2.nabble.com> <1348777756492-7581248.post@n2.nabble.com> Date: Thu, 27 Sep 2012 15:55:04 -0500 Message-ID: Subject: Re: Duplicate entry issue with multithreaded application From: Rick Curtis To: users@openjpa.apache.org Content-Type: multipart/alternative; boundary=14dae93411174f6cef04cab52723 --14dae93411174f6cef04cab52723 Content-Type: text/plain; charset=ISO-8859-1 As I said before, that is a different exception than the original one that you posted in this string of notes. Is the problem with the pk (451) or the unique value ("u1")? On Thu, Sep 27, 2012 at 3:29 PM, garpinc wrote: > I reran the test case and it also got the same exception: > > > org.apache.openjpa.persistence.RollbackException: The transaction has been > rolled back. See the nested exceptions for details on the errors that > occurred. > FailedObject: test.KeyClass@5e4b2b75 > at > > org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:594) > at > > test.TestCollectionValueMapper.testUniqueKey(TestCollectionValueMapper.java:148) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at > > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) > at > > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) > at > > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) > at > > org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) > at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) > at > > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) > at > > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) > at > org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) > at org.junit.runners.ParentRunner.run(ParentRunner.java:300) > at > > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) > at > > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) > at > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) > at > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) > at > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) > Caused by: > org.apache.openjpa.persistence.PersistenceException: The transaction has > been rolled back. See the nested exceptions for details on the errors that > occurred. > FailedObject: test.KeyClass@5e4b2b75 > at > > org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2337) > at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2174) > at > org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2072) > at > org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1990) > at > > org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81) > at > org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1514) > at > > org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:933) > at > > org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:570) > ... 24 more > Caused by: > org.apache.openjpa.persistence.EntityExistsException: Unique index or > primary key violation: "U_KEYCLSS_UNIQUEFIELD1_INDEX_4 ON > PUBLIC.KEYCLASS(UNIQUEFIELD1)"; SQL statement: > INSERT INTO KeyClass (pk, otherField1, uniqueField1) VALUES (?, ?, ?) > [23505-160] {prepstmnt 1449799553 INSERT INTO KeyClass (pk, otherField1, > uniqueField1) VALUES (?, ?, ?) [params=(long) 451, (null) null, (String) > u1]} [code=23505, state=23505] > FailedObject: test.KeyClass@5e4b2b75 > at > org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4903) > at > > org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4878) > at > org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136) > at > org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:78) > at > > org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:143) > at > > org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:79) > at > > org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:99) > at > > org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:87) > at > > org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:357) > at > > org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flushGraph(ConstraintUpdateManager.java:349) > at > > org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:97) > at > > org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:59) > at > > org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:103) > at > > org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:76) > at > > org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:713) > at > > org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:131) > ... 31 more > Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Unique index > or primary key violation: "U_KEYCLSS_UNIQUEFIELD1_INDEX_4 ON > PUBLIC.KEYCLASS(UNIQUEFIELD1)"; SQL statement: > INSERT INTO KeyClass (pk, otherField1, uniqueField1) VALUES (?, ?, ?) > [23505-160] {prepstmnt 1449799553 INSERT INTO KeyClass (pk, otherField1, > uniqueField1) VALUES (?, ?, ?) [params=(long) 451, (null) null, (String) > u1]} [code=23505, state=23505] > at > > org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:247) > at > > org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:223) > at > > org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$1000(LoggingConnectionDecorator.java:72) > at > > org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:1162) > at > > org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:272) > at > > org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1741) > at > > org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.executeUpdate(PreparedStatementManagerImpl.java:267) > at > > org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:118) > ... 42 more > > > > > > -- *Rick Curtis* --14dae93411174f6cef04cab52723--