summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaspar De Groot2011-09-05 23:23:26 (EDT)
committerCaspar De Groot2011-09-05 23:23:26 (EDT)
commit6669e48d893764e3e76e398a19421572ebcbec99 (patch)
tree89950624c85e9d49c2ddfb94846237e4ad45704f
parent2ee51e2578cb98c1c644ade12f450b1bf04a4054 (diff)
downloadcdo-6669e48d893764e3e76e398a19421572ebcbec99.zip
cdo-6669e48d893764e3e76e398a19421572ebcbec99.tar.gz
cdo-6669e48d893764e3e76e398a19421572ebcbec99.tar.bz2
[351912] Lock coordination with SynchronizableRepositories
https://bugs.eclipse.org/bugs/show_bug.cgi?id=351912
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/LockManager.java23
1 files changed, 13 insertions, 10 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/LockManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/LockManager.java
index 26ba1ad..5db93a4 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/LockManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/LockManager.java
@@ -580,8 +580,13 @@ public class LockManager extends RWOLockManager<Object, IView> implements Intern
public boolean handleLockArea(LockArea area)
{
- IView view = durableViews.get(area.getDurableLockingID());
- CheckUtil.checkNull(view, "view");
+ String durableLockingID = area.getDurableLockingID();
+ IView view = durableViews.get(durableLockingID);
+ if (view == null)
+ {
+ view = new DurableView(durableLockingID);
+ durableViews.put(durableLockingID, (DurableView)view);
+ }
Collection<Object> readLocks = new ArrayList<Object>();
Collection<Object> writeLocks = new ArrayList<Object>();
@@ -638,18 +643,13 @@ public class LockManager extends RWOLockManager<Object, IView> implements Intern
return grade;
}
- private IView getOrCreateView(String lockAreaID)
+ private IView getView(String lockAreaID)
{
IView view = openViews.get(lockAreaID);
if (view == null)
{
view = durableViews.get(lockAreaID);
}
- if (view == null)
- {
- view = new DurableView(lockAreaID);
- durableViews.put(lockAreaID, (DurableView)view);
- }
return view;
}
@@ -683,8 +683,11 @@ public class LockManager extends RWOLockManager<Object, IView> implements Intern
else
{
accessor.updateLockArea(lockArea);
- IView view = getOrCreateView(durableLockingID);
- unlock2(view);
+ IView view = getView(durableLockingID);
+ if (view != null)
+ {
+ unlock2(view);
+ }
new DurableLockLoader().handleLockArea(lockArea);
}
}