Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEsteban Dugueperoux2015-11-10 17:17:14 +0000
committerEsteban DUGUEPEROUX2015-11-23 08:26:21 +0000
commit12fe06ecee87de477732814a577f54f3ba24506c (patch)
tree85919e8158752dd4111f2e710fd5e1ca51ce98b4
parentd205176345cf81a8b3d9376d861fa1c96b497c69 (diff)
downloadcdo-12fe06ecee87de477732814a577f54f3ba24506c.tar.gz
cdo-12fe06ecee87de477732814a577f54f3ba24506c.tar.xz
cdo-12fe06ecee87de477732814a577f54f3ba24506c.zip
[481382] Have default lock state always stored at commit with prefetch
Change-Id: I371c9213b62f0e115dfbb349d3af003aea8670ae Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=481382 Signed-off-by: Esteban Dugueperoux <esteban.dugueperoux@obeo.fr> Signed-off-by: Eike Stepper <stepper@esc-net.de>
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java24
1 files changed, 15 insertions, 9 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
index c4c4c942bf..fabb91e0b4 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
@@ -784,6 +784,12 @@ public class CDOViewImpl extends AbstractCDOView implements IExecutorServiceProv
newLockState.updateFrom(oldLockState);
lockStates.put(object, newLockState);
}
+ else if (options().isLockStatePrefetchEnabled())
+ {
+ Object lockedObject = getLockTarget(object); // CDOID or CDOIDAndBranch
+ CDOLockState newLockState = CDOLockUtil.createLockState(lockedObject);
+ lockStates.put(object, newLockState);
+ }
super.remapObject(oldID);
}
@@ -2089,8 +2095,6 @@ public class CDOViewImpl extends AbstractCDOView implements IExecutorServiceProv
private boolean lockNotificationsEnabled;
- private boolean lockStatePrefetchEnabled;
-
private CDOLockStateLoadingPolicy lockStateLoadingPolicy = new CDODefaultLockStateLoadingPolicy();
private LockStatePrefetcher lockStatePrefetcher;
@@ -2241,7 +2245,7 @@ public class CDOViewImpl extends AbstractCDOView implements IExecutorServiceProv
public boolean isLockStatePrefetchEnabled()
{
- return lockStatePrefetchEnabled;
+ return lockStatePrefetcher != null;
}
public void setLockStatePrefetchEnabled(boolean enabled)
@@ -2251,20 +2255,22 @@ public class CDOViewImpl extends AbstractCDOView implements IExecutorServiceProv
IEvent event = null;
synchronized (CDOViewImpl.this)
{
- if (enabled != lockStatePrefetchEnabled)
+ if (enabled)
{
- lockStatePrefetchEnabled = enabled;
- if (enabled)
+ if (lockStatePrefetcher == null)
{
lockStatePrefetcher = new LockStatePrefetcher();
+ event = new LockStatePrefetchEventImpl();
}
- else
+ }
+ else
+ {
+ if (lockStatePrefetcher != null)
{
lockStatePrefetcher.dispose();
lockStatePrefetcher = null;
+ event = new LockStatePrefetchEventImpl();
}
-
- event = new LockStatePrefetchEventImpl();
}
}

Back to the top