Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2016-09-18 08:59:48 +0000
committerEike Stepper2016-09-18 08:59:48 +0000
commit9f4af94935e8636d478ef11aae099070c5dffd66 (patch)
treebaa2e13fc9a89790ced819dd1f06f40755694c7b /plugins/org.eclipse.emf.cdo/src/org/eclipse
parent3c5c611a8cf98fc6899719ca918ba713ca427528 (diff)
downloadcdo-9f4af94935e8636d478ef11aae099070c5dffd66.tar.gz
cdo-9f4af94935e8636d478ef11aae099070c5dffd66.tar.xz
cdo-9f4af94935e8636d478ef11aae099070c5dffd66.zip
[473804] Undo of massive deletion very long
https://bugs.eclipse.org/bugs/show_bug.cgi?id=473804
Diffstat (limited to 'plugins/org.eclipse.emf.cdo/src/org/eclipse')
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java55
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java134
2 files changed, 66 insertions, 123 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
index c6719a057a..325063121b 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
@@ -1477,36 +1477,15 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
return null;
}
- /**
- * @since 2.0
- */
@Override
- public InternalCDOObject getObject(CDOID id, boolean loadOnDemand)
+ protected InternalCDOObject getObjectUnsynced(CDOID id, boolean loadOnDemand)
{
- checkActive();
- synchronized (getViewMonitor())
+ if (isObjectNew(id) && isObjectDetached(id))
{
- lockView();
-
- try
- {
- if (CDOIDUtil.isNull(id))
- {
- return null;
- }
-
- if (isObjectNew(id) && isObjectDetached(id))
- {
- throw new ObjectNotFoundException(id, this);
- }
-
- return super.getObject(id, loadOnDemand);
- }
- finally
- {
- unlockView();
- }
+ throw new ObjectNotFoundException(id, this);
}
+
+ return super.getObjectUnsynced(id, loadOnDemand);
}
@Override
@@ -1517,7 +1496,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
private boolean isObjectDetached(CDOID id)
{
- return lastSavepoint.getAllDetachedObjects().containsKey(id);
+ return lastSavepoint.getDetachedObject(id) != null;
}
/**
@@ -2955,25 +2934,13 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
@Override
protected CDOID getXRefTargetID(CDOObject target)
{
- synchronized (getViewMonitor())
+ CDORevisionKey key = cleanRevisions.get(target);
+ if (key != null)
{
- lockView();
-
- try
- {
- CDORevisionKey key = cleanRevisions.get(target);
- if (key != null)
- {
- return key.getID();
- }
-
- return super.getXRefTargetID(target);
- }
- finally
- {
- unlockView();
- }
+ return key.getID();
}
+
+ return super.getXRefTargetID(target);
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java
index ee091e349e..0e8473818d 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java
@@ -1576,24 +1576,12 @@ public abstract class AbstractCDOView extends CDOCommitHistoryProviderImpl<CDOOb
protected CDOID getXRefTargetID(CDOObject target)
{
- synchronized (getViewMonitor())
+ if (FSMUtil.isTransient(target))
{
- lockView();
-
- try
- {
- if (FSMUtil.isTransient(target))
- {
- throw new IllegalArgumentException("Cross referencing for transient objects not supported " + target);
- }
-
- return target.cdoID();
- }
- finally
- {
- unlockView();
- }
+ throw new IllegalArgumentException("Cross referencing for transient objects not supported " + target);
}
+
+ return target.cdoID();
}
public CDOResourceImpl getResource(CDOID resourceID)
@@ -1636,7 +1624,6 @@ public abstract class AbstractCDOView extends CDOCommitHistoryProviderImpl<CDOOb
public InternalCDOObject getObject(CDOID id, boolean loadOnDemand)
{
- checkActive();
if (CDOIDUtil.isNull(id))
{
return null;
@@ -1648,60 +1635,7 @@ public abstract class AbstractCDOView extends CDOCommitHistoryProviderImpl<CDOOb
try
{
- if (rootResource != null && rootResource.cdoID() == id)
- {
- return rootResource;
- }
-
- if (id == lastLookupID)
- {
- return lastLookupObject;
- }
-
- lastLookupID = null;
- lastLookupObject = null;
- InternalCDOObject localLookupObject = null;
-
- if (id.isExternal())
- {
- URI uri = URI.createURI(((CDOIDExternal)id).getURI());
- ResourceSet resourceSet = getResourceSet();
-
- localLookupObject = (InternalCDOObject)CDOUtil.getCDOObject(resourceSet.getEObject(uri, loadOnDemand));
- if (localLookupObject == null)
- {
- if (!loadOnDemand)
- {
- return null;
- }
-
- throw new ObjectNotFoundException(id, this);
- }
- }
- else
- {
- // Needed for recursive call to getObject. (from createObject/cleanObject/getResource/getObject)
- localLookupObject = objects.get(id);
- if (localLookupObject == null)
- {
- if (!loadOnDemand)
- {
- return null;
- }
-
- excludeNewObject(id);
- localLookupObject = createObject(id);
-
- if (id == rootResourceID)
- {
- setRootResource((CDOResourceImpl)localLookupObject);
- }
- }
- }
-
- lastLookupID = id;
- lastLookupObject = localLookupObject;
- return lastLookupObject;
+ return getObjectUnsynced(id, loadOnDemand);
}
finally
{
@@ -1710,24 +1644,66 @@ public abstract class AbstractCDOView extends CDOCommitHistoryProviderImpl<CDOOb
}
}
- protected void excludeNewObject(CDOID id)
+ protected InternalCDOObject getObjectUnsynced(CDOID id, boolean loadOnDemand)
{
- synchronized (getViewMonitor())
+ if (rootResource != null && rootResource.cdoID() == id)
{
- lockView();
+ return rootResource;
+ }
- try
+ if (id == lastLookupID)
+ {
+ return lastLookupObject;
+ }
+
+ lastLookupID = null;
+ lastLookupObject = null;
+ InternalCDOObject localLookupObject = null;
+
+ if (id.isExternal())
+ {
+ URI uri = URI.createURI(((CDOIDExternal)id).getURI());
+ ResourceSet resourceSet = getResourceSet();
+
+ localLookupObject = (InternalCDOObject)CDOUtil.getCDOObject(resourceSet.getEObject(uri, loadOnDemand));
+ if (localLookupObject == null)
{
- if (isObjectNew(id))
+ if (!loadOnDemand)
{
- throw new ObjectNotFoundException(id, this);
+ return null;
}
+
+ throw new ObjectNotFoundException(id, this);
}
- finally
+ }
+ else
+ {
+ // Needed for recursive call to getObject. (from createObject/cleanObject/getResource/getObject)
+ localLookupObject = objects.get(id);
+ if (localLookupObject == null)
{
- unlockView();
+ if (!loadOnDemand)
+ {
+ return null;
+ }
+
+ excludeNewObject(id);
+ localLookupObject = createObject(id);
+
+ if (id == rootResourceID)
+ {
+ setRootResource((CDOResourceImpl)localLookupObject);
+ }
}
}
+
+ lastLookupID = id;
+ lastLookupObject = localLookupObject;
+ return lastLookupObject;
+ }
+
+ protected void excludeNewObject(CDOID id)
+ {
}
public boolean isObjectNew(CDOID id)

Back to the top