openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <curti...@gmail.com>
Subject Re: Duplicate entry issue with multithreaded application
Date Thu, 27 Sep 2012 20:24:39 GMT
Look closer at your exception.... it is quite similar, but coming from a
different bit of code.

On Thu, Sep 27, 2012 at 3:20 PM, garpinc <garpinc@yahoo.com> wrote:

> As far as I can tell i'm still getting the exception:
> 12-09-27 16:17:48,861 [pool-31-thread-1] [] DEBUG           -
> c.c.a.r.LinkedDatasetPersist-
> 295905694:(0:01:41.017)-(pool-31-thread-1)-Sleeping 5
> secs:<openjpa-2.2.0-r422266:1244990 fatal store error>
> org.apache.openjpa.persistence.RollbackException: The transaction has been
> rolled back.  See the nested exceptions for details on the errors that
> occurred.
> FailedObject:
>
> com.cambridgesemantics.anzo.relationalreplicator.jpa.model.AnzoURIToPKImpl@2319435b
>         at
>
> org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:594)
>         at
>
> com.cambridgesemantics.anzo.relationalreplicator.ReplicationJob.commitTransaction(ReplicationJob.java:460)
>         at
>
> com.cambridgesemantics.anzo.relationalreplicator.LinkedDatasetPersist.finishBatch(LinkedDatasetPersist.java:304)
>         at
>
> com.cambridgesemantics.anzo.relationalreplicator.LinkedDatasetPersist.persistDataset(LinkedDatasetPersist.java:231)
>         at
>
> com.cambridgesemantics.anzo.relationalreplicator.LinkedDatasetPersist.persistDataset(LinkedDatasetPersist.java:167)
>         at
>
> com.cambridgesemantics.anzo.relationalreplicator.LinkedDatasetPersist.persistJob(LinkedDatasetPersist.java:162)
>         at
>
> com.cambridgesemantics.anzo.relationalreplicator.ReplicationJob.call(ReplicationJob.java:1189)
>         at
>
> com.cambridgesemantics.anzo.relationalreplicator.ReplicationJob.call(ReplicationJob.java:1)
>         at
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>         at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>         at java.lang.Thread.run(Thread.java:722)
> Caused by: <openjpa-2.2.0-r422266:1244990 fatal general error>
> org.apache.openjpa.persistence.PersistenceException: The transaction has
> been rolled back.  See the nested exceptions for details on the errors that
> occurred.
> FailedObject:
>
> com.cambridgesemantics.anzo.relationalreplicator.jpa.model.AnzoURIToPKImpl@2319435b
>         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)
>         ... 12 more
> Caused by: <openjpa-2.2.0-r422266:1244990 fatal store error>
> org.apache.openjpa.persistence.EntityExistsException: Duplicate entry
> '31453a33c22a895f9a770f5ee6fe8edeace30e08-734f1c627a629e194f9ea9c' for key
> 'U_NZURTPK_URIHASH' {prepstmnt 1776490395 INSERT INTO anzouritopk (pk,
> datasetUri, datasetUriHash, persistedFully, typeUri, typeUriHash, uri,
> uriHash) VALUES (?, ?, ?, ?, ?, ?, ?, ?) [params=(long) 55190, (Reader)
> java.io.StringReader@3c22f76c, (String) N/A, (int) 0, (Reader)
> java.io.StringReader@252a69c0, (String)
> 734f1c627a629e194f9ea9cf0990bbaead59b188, (Reader)
> java.io.StringReader@384cf50, (String)
> 31453a33c22a895f9a770f5ee6fe8edeace30e08]} [code=1062, state=23000]
> FailedObject:
>
> com.cambridgesemantics.anzo.relationalreplicator.jpa.model.AnzoURIToPKImpl@2319435b
>         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)
>         ... 19 more
> Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Duplicate
> entry '31453a33c22a895f9a770f5ee6fe8edeace30e08-734f1c627a629e194f9ea9c'
> for
> key 'U_NZURTPK_URIHASH' {prepstmnt 1776490395 INSERT INTO anzouritopk (pk,
> datasetUri, datasetUriHash, persistedFully, typeUri, typeUriHash, uri,
> uriHash) VALUES (?, ?, ?, ?, ?, ?, ?, ?) [params=(long) 55190, (Reader)
> java.io.StringReader@3c22f76c, (String) N/A, (int) 0, (Reader)
> java.io.StringReader@252a69c0, (String)
> 734f1c627a629e194f9ea9cf0990bbaead59b188, (Reader)
> java.io.StringReader@384cf50, (String)
> 31453a33c22a895f9a770f5ee6fe8edeace30e08]} [code=1062, state=23000]
>         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)
>         ... 30 more
>
>
>
>
> --
*Rick Curtis*

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message