Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEsteban Dugueperoux2015-11-10 12:17:14 -0500
committerEike Stepper2015-11-10 12:17:14 -0500
commit3f6948ebc308c61a5628a9300aa5615f1f565dfd (patch)
tree0e6fda349f9c79d8e062727afca6fb85480e0150
parentc99602465a3f52eb1bc0aa1abcf4ea2cb6cd8e6f (diff)
downloadcdo-change/59636/1.tar.gz
cdo-change/59636/1.tar.xz
cdo-change/59636/1.zip
[481382] Have default lock state always stored at commit with prefetchchange/59636/1
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