Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-02-14 05:21:25 -0500
committerEike Stepper2012-02-14 05:21:25 -0500
commit5cfc82c97137a2c915a2adf8b5ef77f762855555 (patch)
tree4e2290414414b952e8be7022c057ee6b8cb3ab85
parentdb0acb996d03ff9b75c3e074aac40968801e1b25 (diff)
downloadcdo-5cfc82c97137a2c915a2adf8b5ef77f762855555.tar.gz
cdo-5cfc82c97137a2c915a2adf8b5ef77f762855555.tar.xz
cdo-5cfc82c97137a2c915a2adf8b5ef77f762855555.zip
[371344] CDOSession can send out of sequence invalidations to the CDOViews drops/R20120214-1026
https://bugs.eclipse.org/bugs/show_bug.cgi?id=371344
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java59
1 files changed, 46 insertions, 13 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
index ca54e9db7f..06d7fb7847 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
@@ -92,6 +92,7 @@ import org.eclipse.net4j.util.WrappedException;
import org.eclipse.net4j.util.collection.Pair;
import org.eclipse.net4j.util.concurrent.IRWLockManager;
import org.eclipse.net4j.util.concurrent.IRWLockManager.LockType;
+import org.eclipse.net4j.util.concurrent.QueueRunner;
import org.eclipse.net4j.util.concurrent.RWLockManager;
import org.eclipse.net4j.util.container.Container;
import org.eclipse.net4j.util.event.Event;
@@ -179,6 +180,8 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
private OutOfSequenceInvalidations outOfSequenceInvalidations = new OutOfSequenceInvalidations();
+ private QueueRunner invalidationRunner;
+
private CDORepositoryInfo repositoryInfo;
private CDOFetchRuleManager ruleManager = new NOOPFetchRuleManager()
@@ -1199,27 +1202,55 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
long nextPreviousTimeStamp = lastUpdateTime;
for (;;)
{
- Pair<CDOCommitInfo, InternalCDOTransaction> currentPair;
synchronized (outOfSequenceInvalidations)
{
- currentPair = outOfSequenceInvalidations.remove(nextPreviousTimeStamp);
- }
+ Pair<CDOCommitInfo, InternalCDOTransaction> currentPair = outOfSequenceInvalidations
+ .remove(nextPreviousTimeStamp);
- // If we don't have the invalidation that follows the last one we processed,
- // then there is nothing we can do right now
- if (currentPair == null)
- {
- break;
- }
+ // If we don't have the invalidation that follows the last one we processed,
+ // then there is nothing we can do right now
+ if (currentPair == null)
+ {
+ break;
+ }
- CDOCommitInfo currentCommitInfo = currentPair.getElement1();
- InternalCDOTransaction currentSender = currentPair.getElement2();
- nextPreviousTimeStamp = currentCommitInfo.getTimeStamp();
+ final CDOCommitInfo currentCommitInfo = currentPair.getElement1();
+ final InternalCDOTransaction currentSender = currentPair.getElement2();
+ nextPreviousTimeStamp = currentCommitInfo.getTimeStamp();
- invalidateOrdered(currentCommitInfo, currentSender);
+ if (sender == null)
+ {
+ QueueRunner invalidationRunner = getInvalidationRunner();
+ invalidationRunner.addWork(new Runnable()
+ {
+ public void run()
+ {
+ invalidateOrdered(currentCommitInfo, currentSender);
+ }
+ });
+ }
+ else
+ {
+ invalidateOrdered(currentCommitInfo, currentSender);
+ }
+ }
}
}
+ /**
+ * This method is synchronized on outOfSequenceInvalidations by the caller!
+ */
+ private QueueRunner getInvalidationRunner()
+ {
+ if (invalidationRunner == null)
+ {
+ invalidationRunner = new QueueRunner();
+ invalidationRunner.activate();
+ }
+
+ return invalidationRunner;
+ }
+
private void invalidateOrdered(CDOCommitInfo commitInfo, InternalCDOTransaction sender)
{
Map<CDOID, InternalCDORevision> oldRevisions = null;
@@ -1475,6 +1506,8 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
}
views.clear();
+
+ LifecycleUtil.deactivate(invalidationRunner);
outOfSequenceInvalidations.clear();
unhookSessionProtocol();

Back to the top