Community
Participate
Working Groups
Build Identifier: 3.0 From time to time the following exception is thrown: !ENTRY org.eclipse.net4j.util 4 0 2010-05-05 10:03:24.278 !MESSAGE org.h2.jdbc.JdbcBatchUpdateException: Eindeutiger Index oder Primarschlüssel verletzt: BASE_WHITEPAGE_USERPREFERENCES_IDX0 ON PUBLIC.BASE_WHITEPAGE_USERPREFERENCES(CDO_ID, CDO_VERSION, CDO_BRANCH) Unique index or primary key violation: BASE_WHITEPAGE_USERPREFERENCES_IDX0 ON PUBLIC.BASE_WHITEPAGE_USERPREFERENCES(CDO_ID, CDO_VERSION, CDO_BRANCH); SQL statement: INSERT INTO base_whitepage_UserPreferences(cdo_id, cdo_version, cdo_branch, cdo_class, cdo_created, cdo_revised, cdo_resource, cdo_container, cdo_feature, version, workbenchLayout) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23001-117] !STACK 0 org.eclipse.net4j.db.DBException: org.h2.jdbc. PUBLIC.BASE_WHITEPAGE_USERPREFERENCES(CDO_ID, CDO_VERSION, CDO_BRANCH) Unique index or primary key violation: BASE_WHITEPAGE_USERPREFERENCES_IDX0 ON PUBLIC.BASE_WHITEPAGE_USERPREFERENCES(CDO_ID, CDO_VERSION, CDO_BRANCH); SQL statement: INSERT INTO base_whitepage_UserPreferences(cdo_id, cdo_version, cdo_branch, cdo_class, cdo_created, cdo_revised, cdo_resource, cdo_container, cdo_feature, version, workbenchLayout) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23001-117] at org.eclipse.net4j.db.DBUtil.deserializeTable(DBUtil.java:704) at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalMappingStrategy.rawImport(AbstractHorizontalMappingStrategy.java:167) at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.rawImport(DBStoreAccessor.java:857) at org.eclipse.emf.cdo.internal.server.syncing.SynchronizableRepository.replicateRaw(SynchronizableRepository.java:210) at org.eclipse.emf.cdo.internal.net4j.protocol.ReplicateRepositoryRawRequest.confirming(ReplicateRepositoryRawRequest.java:43) at org.eclipse.emf.cdo.internal.net4j.protocol.ReplicateRepositoryRawRequest.confirming(ReplicateRepositoryRawRequest.java:1) at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequest.confirming(CDOClientRequest.java:85) at org.eclipse.net4j.signal.RequestWithConfirmation.doExtendedInput(RequestWithConfirmation.java:123) at org.eclipse.net4j.signal.Signal.doInput(Signal.java:311) at org.eclipse.net4j.signal.RequestWithConfirmation.doExecute(RequestWithConfirmation.java:103) at org.eclipse.net4j.signal.SignalActor.execute(SignalActor.java:66) at org.eclipse.net4j.signal.Signal.runSync(Signal.java:238) at org.eclipse.net4j.signal.SignalProtocol.startSignal(SignalProtocol.java:428) at org.eclipse.net4j.signal.RequestWithConfirmation.doSend(RequestWithConfirmation.java:87) at org.eclipse.net4j.signal.RequestWithConfirmation.send(RequestWithConfirmation.java:73) at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:359) at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.replicateRepositoryRaw(CDOClientProtocol.java:310) at org.eclipse.emf.cdo.internal.server.syncing.RepositorySynchronizer$ReplicateRunnable.run(RepositorySynchronizer.java:391) at org.eclipse.net4j.util.concurrent.QueueRunner.work(QueueRunner.java:26) at org.eclipse.net4j.util.concurrent.QueueRunner.work(QueueRunner.java:1) at org.eclipse.net4j.util.concurrent.QueueWorker.work(QueueWorker.java:75) at org.eclipse.net4j.util.concurrent.Worker$WorkerThread.run(Worker.java:188) Caused by: org.h2.jdbc.JdbcBatchUpdateException: Eindeutiger Index oder Primarschlüssel verletzt: BASE_WHITEPAGE_USERPREFERENCES_IDX0 ON PUBLIC.BASE_WHITEPAGE_USERPREFERENCES(CDO_ID, CDO_VERSION, CDO_BRANCH) Unique index or primary key violation: BASE_WHITEPAGE_USERPREFERENCES_IDX0 ON PUBLIC.BASE_WHITEPAGE_USERPREFERENCES(CDO_ID, CDO_VERSION, CDO_BRANCH); SQL statement: INSERT INTO base_whitepage_UserPreferences(cdo_id, cdo_version, cdo_branch, cdo_class, cdo_created, cdo_revised, cdo_resource, cdo_container, cdo_feature, version, workbenchLayout) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23001-117] at org.h2.jdbc.JdbcPreparedStatement.executeBatch(JdbcPreparedStatement.java:1069) at org.eclipse.net4j.db.DBUtil.deserializeTable(DBUtil.java:700) ... 21 more Have a look at the attached debug screenshot. After this error the clone repository is broken. Reproducible: Sometimes
Created attachment 167940 [details] Debug screenshot A CommitRunnable has two identical changed objects. This causes the primary key violation on the H2 database.
Seems to be in ReplicateRunnable rather than in CommitRunnable.
Erwin, can you try to reproduce this issue in a test case?
I doubt that the screenshot relates to this bug. It rather seems to belong to the resolved bug 312404.
Looking once more, I think it *can* be related to this issue. But the original stack trace is different, i.e. related with ReplicateRunnables. Can it really relate to both runnable types?? Hmm...
Erwin, in your client application, are you moving objects between external and internal (CDO) resources?
(In reply to comment #3) > Erwin, can you try to reproduce this issue in a test case? Tried it but was not successful.
(In reply to comment #5) > Looking once more, I think it *can* be related to this issue. But the original > stack trace is different, i.e. related with ReplicateRunnables. > > Can it really relate to both runnable types?? Hmm... Your are right the stacktrace and picture do not correlate. I'll try to reproduce it again so that stack trace and debug picture matches.
(In reply to comment #6) > Erwin, in your client application, are you moving objects between external and > internal (CDO) resources? No.
I added some log output; looks like the 1st RevisionDelta is duplicated (confirms Erwins comment #1) and the 2nd one gets discarded: on the backend (master repository): TransactionCommitContext.postCommit() createCommitInfo.getChangedObjects(): { CDORevisionDelta[OobNode@OID2555:0v5 --> [CDOFeatureDelta[null, CONTAINER, resource=NULL, container=OID1377, feature=-4], CDOFeatureDelta[name, SET, value=Test Admin 1]]], CDORevisionDelta[OobNode@OID1488:0v24 --> [CDOFeatureDelta[children, LIST, list=[CDOFeatureDelta[children, REMOVE, value=UNKNOWN, index=0]]]]], CDORevisionDelta[OobNode@OID1377:0v26 --> [CDOFeatureDelta[children, LIST, list=[CDOFeatureDelta[children, ADD, value=OID2555, index=0]]]]] } on the client: RepositorySynchronizer.CommitRunnable.run() commitInfo.getChangedObjects(): [ CDORevisionDelta[OobNode@OID2555:0v5 --> [CDOFeatureDelta[null, CONTAINER, resource=NULL, container=OID1377, feature=-4], CDOFeatureDelta[name, SET, value=Test Admin 1]]], CDORevisionDelta[OobNode@OID2555:0v5 --> [CDOFeatureDelta[null, CONTAINER, resource=NULL, container=OID1377, feature=-4], CDOFeatureDelta[name, SET, value=Test Admin 1]]], CDORevisionDelta[OobNode@OID1377:0v26 --> [CDOFeatureDelta[children, LIST, list=[CDOFeatureDelta[children, ADD, value=OID2555, index=0]]]]] ]
Hi Rolf, from looking at the code I still can't see how this duplication/replacement can happen ;-( Can you try to check the "changed objects" at the beginning of this method: CDODataOutputImpl.writeCDOChangeSetData(CDOChangeSetData) And at the end of this method: CDODataInputImpl.readCDOChangeSetData() I think this method is also interesting: TransactionCommitContext.createCommitData() Maybe you have a chance to look into the array that backs the changed objects list. The best check would be to iterate over the IndexedList right after it was created. I'll attach a patch that shows you where to set breakpoints and inspect the data
Created attachment 172673 [details] Code places to inspect
Rebasing all outstanding 3.0 problem reports to version 3.0.1
Thg has never been reproducible and the user has reported that it has not occured for a long period. Closing as WORKSFORME for now. Please reopen if you encounter the same issue again.
Fixing wrong bug version.