summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-01-17 11:31:34 (EST)
committerEike Stepper2008-01-17 11:31:34 (EST)
commitfb0ffb57dafc5d8918f28fc6a737edd9f3aef9c3 (patch)
tree2b006f54a27f83cb42894c3f3e0a41772ccd76ce
parentaed931f080a40cd590b366392c00ffb4266f8e46 (diff)
downloadcdo-fb0ffb57dafc5d8918f28fc6a737edd9f3aef9c3.zip
cdo-fb0ffb57dafc5d8918f28fc6a737edd9f3aef9c3.tar.gz
cdo-fb0ffb57dafc5d8918f28fc6a737edd9f3aef9c3.tar.bz2
[214752] Concurrency problem
https://bugs.eclipse.org/bugs/show_bug.cgi?id=214752
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDORevisionManagerImpl.java20
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java15
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionRequest.java15
3 files changed, 24 insertions, 26 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDORevisionManagerImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDORevisionManagerImpl.java
index eccf56c..7ad2dd1 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDORevisionManagerImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDORevisionManagerImpl.java
@@ -17,6 +17,7 @@ import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionResolverImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl.MoveableList;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
+import org.eclipse.emf.cdo.protocol.revision.CDODuplicateRevisionException;
import org.eclipse.emf.cdo.protocol.revision.CDOReferenceProxy;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.emf.cdo.protocol.util.TransportException;
@@ -28,6 +29,7 @@ import org.eclipse.emf.internal.cdo.protocol.LoadRevisionByVersionRequest;
import org.eclipse.emf.internal.cdo.protocol.LoadRevisionRequest;
import org.eclipse.net4j.channel.IChannel;
+import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
import org.eclipse.net4j.internal.util.om.trace.PerfTracer;
import org.eclipse.net4j.signal.failover.IFailOverStrategy;
@@ -40,6 +42,8 @@ import java.util.List;
*/
public class CDORevisionManagerImpl extends CDORevisionResolverImpl implements CDORevisionManager
{
+ private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_REVISION, CDORevisionManagerImpl.class);
+
private static final PerfTracer LOADING = new PerfTracer(OM.PERF_REVISION_LOADING, CDORevisionManagerImpl.class);
private CDOSessionImpl session;
@@ -56,6 +60,22 @@ public class CDORevisionManagerImpl extends CDORevisionResolverImpl implements C
return session;
}
+ @Override
+ public void addRevision(CDORevisionImpl revision) throws CDODuplicateRevisionException
+ {
+ try
+ {
+ super.addRevision(revision);
+ }
+ catch (CDODuplicateRevisionException ignore)
+ {
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Ignorable exception on client side", ignore);
+ }
+ }
+ }
+
public CDOID resolveReferenceProxy(CDOReferenceProxy referenceProxy)
{
// Get proxy values
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
index 297d83c..6cae226 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
@@ -18,7 +18,6 @@ import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
-import org.eclipse.emf.cdo.protocol.revision.CDODuplicateRevisionException;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.emf.cdo.protocol.revision.delta.CDOFeatureDelta;
import org.eclipse.emf.cdo.protocol.util.TransportException;
@@ -404,18 +403,8 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
revision.setCreated(data.getTimeStamp());
revision.adjustReferences(idMappings);
- try
- {
- CDORevisionManagerImpl revisionManager = view.getSession().getRevisionManager();
- revisionManager.addRevision(revision);
- }
- catch (CDODuplicateRevisionException ignore)
- {
- if (TRACER.isEnabled())
- {
- TRACER.trace("Ignorable exception on client side", ignore);
- }
- }
+ CDORevisionManagerImpl revisionManager = view.getSession().getRevisionManager();
+ revisionManager.addRevision(revision);
changeState(object, CDOState.CLEAN);
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionRequest.java
index 7baacd3..f74193c 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionRequest.java
@@ -16,7 +16,6 @@ import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.protocol.analyzer.CDOFetchRule;
-import org.eclipse.emf.cdo.protocol.revision.CDODuplicateRevisionException;
import org.eclipse.emf.internal.cdo.CDORevisionManagerImpl;
import org.eclipse.emf.internal.cdo.CDOSessionImpl;
@@ -138,18 +137,8 @@ public class LoadRevisionRequest extends CDOClientRequest<List<CDORevisionImpl>>
}
for (int i = 0; i < size; i++)
{
- try
- {
- CDORevisionImpl revision = new CDORevisionImpl(in, revisionManager, packageManager);
- revisionManager.addRevision(revision);
- }
- catch (CDODuplicateRevisionException ex)
- {
- if (PROTOCOL.isEnabled())
- {
- PROTOCOL.trace(ex);
- }
- }
+ CDORevisionImpl revision = new CDORevisionImpl(in, revisionManager, packageManager);
+ revisionManager.addRevision(revision);
}
}