Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2018-03-27 02:14:09 -0400
committerEike Stepper2018-03-27 02:14:09 -0400
commit420192fdb9ef98e9906fed57916e1f1da769cf5b (patch)
treeec93a37180267e2cad1fc057561fc78ef6ebde16
parent83ec3d372871d39d9dde9716d5484927ce8b57e1 (diff)
downloadcdo-420192fdb9ef98e9906fed57916e1f1da769cf5b.tar.gz
cdo-420192fdb9ef98e9906fed57916e1f1da769cf5b.tar.xz
cdo-420192fdb9ef98e9906fed57916e1f1da769cf5b.zip
[532600] Memory not freed when repository is deleted
https://bugs.eclipse.org/bugs/show_bug.cgi?id=532600
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/AbstractMappingStrategy.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalClassMapping.java54
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java52
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalBranchingClassMapping.java174
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalNonAuditClassMapping.java98
-rw-r--r--plugins/org.eclipse.emf.cdo.server/.settings/.api_filters12
-rw-r--r--plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF18
-rw-r--r--plugins/org.eclipse.emf.cdo.server/pom.xml2
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/StoreThreadLocal.java16
9 files changed, 187 insertions, 246 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/AbstractMappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/AbstractMappingStrategy.java
index 1de3e75ff8..a9fb07f093 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/AbstractMappingStrategy.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/AbstractMappingStrategy.java
@@ -39,6 +39,7 @@ import org.eclipse.emf.cdo.server.db.mapping.IMappingStrategy;
import org.eclipse.emf.cdo.server.db.mapping.ITypeMapping;
import org.eclipse.emf.cdo.server.internal.db.DBAnnotation;
import org.eclipse.emf.cdo.server.internal.db.ObjectIDIterator;
+import org.eclipse.emf.cdo.server.internal.db.bundle.OM;
import org.eclipse.emf.cdo.spi.common.commit.CDOChangeSetSegment;
import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageInfo;
import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageRegistry;
@@ -824,7 +825,11 @@ public abstract class AbstractMappingStrategy extends Lifecycle implements IMapp
{
for (IClassMapping classMapping : classMappings.values())
{
- LifecycleUtil.deactivate(classMapping);
+ Exception exception = LifecycleUtil.deactivate(classMapping);
+ if (exception != null)
+ {
+ OM.LOG.warn(exception);
+ }
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalClassMapping.java
index 88281b8424..cb0d7519f7 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalClassMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalClassMapping.java
@@ -24,6 +24,11 @@ import org.eclipse.emf.cdo.common.revision.CDOList;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.CDORevisionHandler;
import org.eclipse.emf.cdo.common.revision.CDORevisionManager;
+import org.eclipse.emf.cdo.common.revision.delta.CDOAddFeatureDelta;
+import org.eclipse.emf.cdo.common.revision.delta.CDOClearFeatureDelta;
+import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDeltaVisitor;
+import org.eclipse.emf.cdo.common.revision.delta.CDOMoveFeatureDelta;
+import org.eclipse.emf.cdo.common.revision.delta.CDORemoveFeatureDelta;
import org.eclipse.emf.cdo.eresource.EresourcePackage;
import org.eclipse.emf.cdo.server.IRepository;
import org.eclipse.emf.cdo.server.IStoreAccessor.QueryXRefsContext;
@@ -41,6 +46,7 @@ import org.eclipse.emf.cdo.spi.common.commit.CDOChangeSetSegment;
import org.eclipse.emf.cdo.spi.common.revision.DetachedCDORevision;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDOList;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
+import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionDelta;
import org.eclipse.net4j.db.DBException;
import org.eclipse.net4j.db.DBType;
@@ -53,6 +59,7 @@ import org.eclipse.net4j.db.ddl.IDBField;
import org.eclipse.net4j.db.ddl.IDBIndex;
import org.eclipse.net4j.db.ddl.IDBSchema;
import org.eclipse.net4j.db.ddl.IDBTable;
+import org.eclipse.net4j.util.ImplementationError;
import org.eclipse.net4j.util.lifecycle.IDeactivateable;
import org.eclipse.net4j.util.om.monitor.OMMonitor;
import org.eclipse.net4j.util.om.monitor.OMMonitor.Async;
@@ -1089,4 +1096,51 @@ public abstract class AbstractHorizontalClassMapping implements IClassMapping, I
}
}
}
+
+ /**
+ * @author Eike Stepper
+ */
+ protected abstract class AbstractFeatureDeltaWriter implements CDOFeatureDeltaVisitor
+ {
+ protected IDBStoreAccessor accessor;
+
+ protected long created;
+
+ protected CDOID id;
+
+ public final void process(IDBStoreAccessor accessor, InternalCDORevisionDelta delta, long created)
+ {
+ this.accessor = accessor;
+ this.created = created;
+ id = delta.getID();
+
+ doProcess(delta);
+ }
+
+ protected abstract void doProcess(InternalCDORevisionDelta delta);
+
+ @Deprecated
+ public final void visit(CDOAddFeatureDelta delta)
+ {
+ throw new ImplementationError("Should not be called"); //$NON-NLS-1$
+ }
+
+ @Deprecated
+ public final void visit(CDORemoveFeatureDelta delta)
+ {
+ throw new ImplementationError("Should not be called"); //$NON-NLS-1$
+ }
+
+ @Deprecated
+ public final void visit(CDOMoveFeatureDelta delta)
+ {
+ throw new ImplementationError("Should not be called"); //$NON-NLS-1$
+ }
+
+ @Deprecated
+ public final void visit(CDOClearFeatureDelta delta)
+ {
+ throw new ImplementationError("Should not be called"); //$NON-NLS-1$
+ }
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java
index f6f73b7caa..873c9fe97a 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java
@@ -21,13 +21,8 @@ import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.revision.CDOList;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.CDORevisionHandler;
-import org.eclipse.emf.cdo.common.revision.delta.CDOAddFeatureDelta;
-import org.eclipse.emf.cdo.common.revision.delta.CDOClearFeatureDelta;
import org.eclipse.emf.cdo.common.revision.delta.CDOContainerFeatureDelta;
-import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDeltaVisitor;
import org.eclipse.emf.cdo.common.revision.delta.CDOListFeatureDelta;
-import org.eclipse.emf.cdo.common.revision.delta.CDOMoveFeatureDelta;
-import org.eclipse.emf.cdo.common.revision.delta.CDORemoveFeatureDelta;
import org.eclipse.emf.cdo.common.revision.delta.CDOSetFeatureDelta;
import org.eclipse.emf.cdo.common.revision.delta.CDOUnsetFeatureDelta;
import org.eclipse.emf.cdo.eresource.EresourcePackage;
@@ -104,15 +99,6 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping
private String sqlRawDeleteAttributes;
- private ThreadLocal<FeatureDeltaWriter> deltaWriter = new ThreadLocal<FeatureDeltaWriter>()
- {
- @Override
- protected FeatureDeltaWriter initialValue()
- {
- return new FeatureDeltaWriter();
- }
- };
-
public HorizontalAuditClassMapping(AbstractHorizontalMappingStrategy mappingStrategy, EClass eClass)
{
super(mappingStrategy, eClass);
@@ -626,7 +612,8 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping
try
{
async = monitor.forkAsync();
- FeatureDeltaWriter writer = deltaWriter.get();
+
+ FeatureDeltaWriter writer = new FeatureDeltaWriter();
writer.process(accessor, delta, created);
}
finally
@@ -903,25 +890,17 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping
/**
* @author Stefan Winkler
*/
- private class FeatureDeltaWriter implements CDOFeatureDeltaVisitor
+ private final class FeatureDeltaWriter extends AbstractFeatureDeltaWriter
{
- private IDBStoreAccessor accessor;
-
- private long created;
-
- private CDOID id;
-
private int oldVersion;
private InternalCDORevision newRevision;
private int branchId;
- public void process(IDBStoreAccessor accessor, InternalCDORevisionDelta delta, long created)
+ @Override
+ protected void doProcess(InternalCDORevisionDelta delta)
{
- this.accessor = accessor;
- this.created = created;
- id = delta.getID();
branchId = delta.getBranch().getID();
oldVersion = delta.getVersion();
@@ -947,21 +926,6 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping
writeValues(accessor, newRevision);
}
- public void visit(CDOMoveFeatureDelta delta)
- {
- throw new ImplementationError("Should not be called"); //$NON-NLS-1$
- }
-
- public void visit(CDOAddFeatureDelta delta)
- {
- throw new ImplementationError("Should not be called"); //$NON-NLS-1$
- }
-
- public void visit(CDORemoveFeatureDelta delta)
- {
- throw new ImplementationError("Should not be called"); //$NON-NLS-1$
- }
-
public void visit(CDOSetFeatureDelta delta)
{
delta.applyTo(newRevision);
@@ -975,15 +939,11 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping
public void visit(CDOListFeatureDelta delta)
{
delta.applyTo(newRevision);
+
IListMappingDeltaSupport listMapping = (IListMappingDeltaSupport)getListMapping(delta.getFeature());
listMapping.processDelta(accessor, id, branchId, oldVersion, oldVersion + 1, created, delta);
}
- public void visit(CDOClearFeatureDelta delta)
- {
- throw new ImplementationError("Should not be called"); //$NON-NLS-1$
- }
-
public void visit(CDOContainerFeatureDelta delta)
{
delta.applyTo(newRevision);
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalBranchingClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalBranchingClassMapping.java
index 61ef33195d..f77135abcd 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalBranchingClassMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalBranchingClassMapping.java
@@ -23,13 +23,8 @@ import org.eclipse.emf.cdo.common.revision.CDOList;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.CDORevisionHandler;
import org.eclipse.emf.cdo.common.revision.CDORevisionManager;
-import org.eclipse.emf.cdo.common.revision.delta.CDOAddFeatureDelta;
-import org.eclipse.emf.cdo.common.revision.delta.CDOClearFeatureDelta;
import org.eclipse.emf.cdo.common.revision.delta.CDOContainerFeatureDelta;
-import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDeltaVisitor;
import org.eclipse.emf.cdo.common.revision.delta.CDOListFeatureDelta;
-import org.eclipse.emf.cdo.common.revision.delta.CDOMoveFeatureDelta;
-import org.eclipse.emf.cdo.common.revision.delta.CDORemoveFeatureDelta;
import org.eclipse.emf.cdo.common.revision.delta.CDOSetFeatureDelta;
import org.eclipse.emf.cdo.common.revision.delta.CDOUnsetFeatureDelta;
import org.eclipse.emf.cdo.eresource.EresourcePackage;
@@ -78,98 +73,6 @@ import java.util.Set;
*/
public class HorizontalBranchingClassMapping extends AbstractHorizontalClassMapping implements IClassMappingAuditSupport, IClassMappingDeltaSupport
{
- /**
- * @author Stefan Winkler
- */
- private class FeatureDeltaWriter implements CDOFeatureDeltaVisitor
- {
- private IDBStoreAccessor accessor;
-
- private long created;
-
- private CDOID id;
-
- private CDOBranch targetBranch;
-
- private int oldVersion;
-
- private int newVersion;
-
- private InternalCDORevision newRevision;
-
- public void process(IDBStoreAccessor accessor, InternalCDORevisionDelta delta, long created)
- {
- this.accessor = accessor;
- this.created = created;
- id = delta.getID();
- oldVersion = delta.getVersion();
-
- if (TRACER.isEnabled())
- {
- TRACER.format("FeatureDeltaWriter: old version: {0}, new version: {1}", oldVersion, oldVersion + 1); //$NON-NLS-1$
- }
-
- InternalCDORevision originalRevision = (InternalCDORevision)accessor.getTransaction().getRevision(id);
- newRevision = originalRevision.copy();
- targetBranch = accessor.getTransaction().getBranch();
- newRevision.adjustForCommit(targetBranch, created);
-
- newVersion = newRevision.getVersion();
-
- // process revision delta tree
- delta.accept(this);
-
- if (newVersion != CDORevision.FIRST_VERSION)
- {
- reviseOldRevision(accessor, id, delta.getBranch(), newRevision.getTimeStamp() - 1);
- }
-
- writeValues(accessor, newRevision);
- }
-
- public void visit(CDOMoveFeatureDelta delta)
- {
- throw new ImplementationError("Should not be called"); //$NON-NLS-1$
- }
-
- public void visit(CDOAddFeatureDelta delta)
- {
- throw new ImplementationError("Should not be called"); //$NON-NLS-1$
- }
-
- public void visit(CDORemoveFeatureDelta delta)
- {
- throw new ImplementationError("Should not be called"); //$NON-NLS-1$
- }
-
- public void visit(CDOSetFeatureDelta delta)
- {
- delta.applyTo(newRevision);
- }
-
- public void visit(CDOUnsetFeatureDelta delta)
- {
- delta.applyTo(newRevision);
- }
-
- public void visit(CDOListFeatureDelta delta)
- {
- delta.applyTo(newRevision);
- IListMappingDeltaSupport listMapping = (IListMappingDeltaSupport)getListMapping(delta.getFeature());
- listMapping.processDelta(accessor, id, targetBranch.getID(), oldVersion, newVersion, created, delta);
- }
-
- public void visit(CDOClearFeatureDelta delta)
- {
- throw new ImplementationError("Should not be called"); //$NON-NLS-1$
- }
-
- public void visit(CDOContainerFeatureDelta delta)
- {
- delta.applyTo(newRevision);
- }
- }
-
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, HorizontalBranchingClassMapping.class);
private String sqlInsertAttributes;
@@ -190,15 +93,6 @@ public class HorizontalBranchingClassMapping extends AbstractHorizontalClassMapp
private String sqlRawDeleteAttributes;
- private ThreadLocal<FeatureDeltaWriter> deltaWriter = new ThreadLocal<FeatureDeltaWriter>()
- {
- @Override
- protected FeatureDeltaWriter initialValue()
- {
- return new FeatureDeltaWriter();
- }
- };
-
public HorizontalBranchingClassMapping(AbstractHorizontalMappingStrategy mappingStrategy, EClass eClass)
{
super(mappingStrategy, eClass);
@@ -1016,7 +910,8 @@ public class HorizontalBranchingClassMapping extends AbstractHorizontalClassMapp
try
{
async = monitor.forkAsync();
- FeatureDeltaWriter writer = deltaWriter.get();
+
+ FeatureDeltaWriter writer = new FeatureDeltaWriter();
writer.process(accessor, delta, created);
}
finally
@@ -1060,4 +955,69 @@ public class HorizontalBranchingClassMapping extends AbstractHorizontalClassMapp
monitor.done();
}
}
+
+ /**
+ * @author Stefan Winkler
+ */
+ private final class FeatureDeltaWriter extends AbstractFeatureDeltaWriter
+ {
+ private CDOBranch targetBranch;
+
+ private int oldVersion;
+
+ private int newVersion;
+
+ private InternalCDORevision newRevision;
+
+ @Override
+ protected void doProcess(InternalCDORevisionDelta delta)
+ {
+ oldVersion = delta.getVersion();
+
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("FeatureDeltaWriter: old version: {0}, new version: {1}", oldVersion, oldVersion + 1); //$NON-NLS-1$
+ }
+
+ InternalCDORevision originalRevision = (InternalCDORevision)accessor.getTransaction().getRevision(id);
+ newRevision = originalRevision.copy();
+ targetBranch = accessor.getTransaction().getBranch();
+ newRevision.adjustForCommit(targetBranch, created);
+
+ newVersion = newRevision.getVersion();
+
+ // process revision delta tree
+ delta.accept(this);
+
+ if (newVersion != CDORevision.FIRST_VERSION)
+ {
+ reviseOldRevision(accessor, id, delta.getBranch(), newRevision.getTimeStamp() - 1);
+ }
+
+ writeValues(accessor, newRevision);
+ }
+
+ public void visit(CDOSetFeatureDelta delta)
+ {
+ delta.applyTo(newRevision);
+ }
+
+ public void visit(CDOUnsetFeatureDelta delta)
+ {
+ delta.applyTo(newRevision);
+ }
+
+ public void visit(CDOListFeatureDelta delta)
+ {
+ delta.applyTo(newRevision);
+
+ IListMappingDeltaSupport listMapping = (IListMappingDeltaSupport)getListMapping(delta.getFeature());
+ listMapping.processDelta(accessor, id, targetBranch.getID(), oldVersion, newVersion, created, delta);
+ }
+
+ public void visit(CDOContainerFeatureDelta delta)
+ {
+ delta.applyTo(newRevision);
+ }
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalNonAuditClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalNonAuditClassMapping.java
index 2879544040..5bf405e926 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalNonAuditClassMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalNonAuditClassMapping.java
@@ -19,14 +19,8 @@ import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.revision.CDOList;
import org.eclipse.emf.cdo.common.revision.CDORevision;
-import org.eclipse.emf.cdo.common.revision.delta.CDOAddFeatureDelta;
-import org.eclipse.emf.cdo.common.revision.delta.CDOClearFeatureDelta;
import org.eclipse.emf.cdo.common.revision.delta.CDOContainerFeatureDelta;
-import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDeltaVisitor;
import org.eclipse.emf.cdo.common.revision.delta.CDOListFeatureDelta;
-import org.eclipse.emf.cdo.common.revision.delta.CDOMoveFeatureDelta;
-import org.eclipse.emf.cdo.common.revision.delta.CDORemoveFeatureDelta;
-import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
import org.eclipse.emf.cdo.common.revision.delta.CDOSetFeatureDelta;
import org.eclipse.emf.cdo.common.revision.delta.CDOUnsetFeatureDelta;
import org.eclipse.emf.cdo.eresource.EresourcePackage;
@@ -88,15 +82,6 @@ public class HorizontalNonAuditClassMapping extends AbstractHorizontalClassMappi
private boolean hasLists;
- private ThreadLocal<FeatureDeltaWriter> deltaWriter = new ThreadLocal<FeatureDeltaWriter>()
- {
- @Override
- protected FeatureDeltaWriter initialValue()
- {
- return new FeatureDeltaWriter();
- }
- };
-
public HorizontalNonAuditClassMapping(AbstractHorizontalMappingStrategy mappingStrategy, EClass eClass)
{
super(mappingStrategy, eClass);
@@ -508,7 +493,8 @@ public class HorizontalNonAuditClassMapping extends AbstractHorizontalClassMappi
try
{
async = monitor.forkAsync();
- FeatureDeltaWriter writer = deltaWriter.get();
+
+ FeatureDeltaWriter writer = new FeatureDeltaWriter();
writer.process(accessor, delta, created);
}
finally
@@ -528,22 +514,16 @@ public class HorizontalNonAuditClassMapping extends AbstractHorizontalClassMappi
/**
* @author Eike Stepper
*/
- private class FeatureDeltaWriter implements CDOFeatureDeltaVisitor
+ private final class FeatureDeltaWriter extends AbstractFeatureDeltaWriter
{
- private CDOID id;
-
- private int oldVersion;
+ private final List<Pair<ITypeMapping, Object>> attributeChanges = new ArrayList<Pair<ITypeMapping, Object>>();
- private long created;
+ private final List<Pair<EStructuralFeature, Integer>> listSizeChanges = new ArrayList<Pair<EStructuralFeature, Integer>>();
- private IDBStoreAccessor accessor;
+ private int oldVersion;
private boolean updateContainer;
- private List<Pair<ITypeMapping, Object>> attributeChanges;
-
- private List<Pair<EStructuralFeature, Integer>> listSizeChanges;
-
private int newContainingFeatureID;
private CDOID newContainerID;
@@ -554,48 +534,20 @@ public class HorizontalNonAuditClassMapping extends AbstractHorizontalClassMappi
private int newVersion;
- public FeatureDeltaWriter()
- {
- attributeChanges = new ArrayList<Pair<ITypeMapping, Object>>();
- listSizeChanges = new ArrayList<Pair<EStructuralFeature, Integer>>();
- }
-
- protected void reset()
- {
- attributeChanges.clear();
- listSizeChanges.clear();
- updateContainer = false;
- }
-
- public void process(IDBStoreAccessor accessor, CDORevisionDelta delta, long created)
+ @Override
+ protected void doProcess(InternalCDORevisionDelta delta)
{
- try
- {
- // Set context
- id = delta.getID();
+ // Set context
+ id = delta.getID();
- branchId = delta.getBranch().getID();
- oldVersion = delta.getVersion();
- newVersion = oldVersion + 1;
- this.created = created;
- this.accessor = accessor;
+ branchId = delta.getBranch().getID();
+ oldVersion = delta.getVersion();
+ newVersion = oldVersion + 1;
- // Process revision delta tree
- delta.accept(this);
+ // Process revision delta tree
+ delta.accept(this);
- updateAttributes();
- }
- finally
- {
- // Clean up
- reset();
- }
- }
-
- @Deprecated
- public void visit(CDOMoveFeatureDelta delta)
- {
- throw new ImplementationError("Should not be called"); //$NON-NLS-1$
+ updateAttributes();
}
public void visit(CDOSetFeatureDelta delta)
@@ -644,24 +596,6 @@ public class HorizontalNonAuditClassMapping extends AbstractHorizontalClassMappi
}
}
- @Deprecated
- public void visit(CDOClearFeatureDelta delta)
- {
- throw new ImplementationError("Should not be called"); //$NON-NLS-1$
- }
-
- @Deprecated
- public void visit(CDOAddFeatureDelta delta)
- {
- throw new ImplementationError("Should not be called"); //$NON-NLS-1$
- }
-
- @Deprecated
- public void visit(CDORemoveFeatureDelta delta)
- {
- throw new ImplementationError("Should not be called"); //$NON-NLS-1$
- }
-
public void visit(CDOContainerFeatureDelta delta)
{
newContainingFeatureID = delta.getContainerFeatureID();
diff --git a/plugins/org.eclipse.emf.cdo.server/.settings/.api_filters b/plugins/org.eclipse.emf.cdo.server/.settings/.api_filters
index a47bb68373..c3fa8e3c11 100644
--- a/plugins/org.eclipse.emf.cdo.server/.settings/.api_filters
+++ b/plugins/org.eclipse.emf.cdo.server/.settings/.api_filters
@@ -7,6 +7,12 @@
<message_argument value="org.eclipse.emf.cdo.server_4.6.100"/>
</message_arguments>
</filter>
+ <filter id="305324134">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.cdo.server.embedded.CDOSession"/>
+ <message_argument value="org.eclipse.emf.cdo.server_4.7.0"/>
+ </message_arguments>
+ </filter>
</resource>
<resource path="META-INF/MANIFEST.MF" type="org.eclipse.emf.cdo.server.embedded.CDOSessionConfiguration">
<filter id="305324134">
@@ -15,6 +21,12 @@
<message_argument value="org.eclipse.emf.cdo.server_4.6.100"/>
</message_arguments>
</filter>
+ <filter id="305324134">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.cdo.server.embedded.CDOSessionConfiguration"/>
+ <message_argument value="org.eclipse.emf.cdo.server_4.7.0"/>
+ </message_arguments>
+ </filter>
</resource>
<resource path="src/org/eclipse/emf/cdo/internal/server/LockingManager.java" type="org.eclipse.emf.cdo.internal.server.LockingManager$DurableView">
<filter id="574619656">
diff --git a/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF
index 3dd066b8de..1ca7355c13 100644
--- a/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.emf.cdo.server;singleton:=true
-Bundle-Version: 4.6.100.qualifier
+Bundle-Version: 4.7.0.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -10,18 +10,18 @@ Bundle-Activator: org.eclipse.emf.cdo.internal.server.bundle.OM$Activator
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ClassPath: .
Require-Bundle: org.eclipse.emf.cdo;bundle-version="[4.0.0,5.0.0)";visibility:=reexport
-Export-Package: org.eclipse.emf.cdo.internal.server;version="4.6.100";
+Export-Package: org.eclipse.emf.cdo.internal.server;version="4.7.0";
x-friends:="org.eclipse.emf.cdo.server.db,
org.eclipse.emf.cdo.server.net4j,
org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.workspace,
org.eclipse.emf.cdo.server.hibernate,
org.eclipse.emf.cdo.server.embedded",
- org.eclipse.emf.cdo.internal.server.bundle;version="4.6.100";x-internal:=true,
- org.eclipse.emf.cdo.internal.server.mem;version="4.6.100";x-friends:="org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.internal.server.messages;version="4.6.100";x-internal:=true,
- org.eclipse.emf.cdo.internal.server.syncing;version="4.6.100";x-friends:="org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.server;version="4.6.100",
- org.eclipse.emf.cdo.server.mem;version="4.6.100",
- org.eclipse.emf.cdo.spi.server;version="4.6.100"
+ org.eclipse.emf.cdo.internal.server.bundle;version="4.7.0";x-internal:=true,
+ org.eclipse.emf.cdo.internal.server.mem;version="4.7.0";x-friends:="org.eclipse.emf.cdo.tests",
+ org.eclipse.emf.cdo.internal.server.messages;version="4.7.0";x-internal:=true,
+ org.eclipse.emf.cdo.internal.server.syncing;version="4.7.0";x-friends:="org.eclipse.emf.cdo.tests",
+ org.eclipse.emf.cdo.server;version="4.7.0",
+ org.eclipse.emf.cdo.server.mem;version="4.7.0",
+ org.eclipse.emf.cdo.spi.server;version="4.7.0"
Automatic-Module-Name: org.eclipse.emf.cdo.server
diff --git a/plugins/org.eclipse.emf.cdo.server/pom.xml b/plugins/org.eclipse.emf.cdo.server/pom.xml
index 1685730d47..18345f690a 100644
--- a/plugins/org.eclipse.emf.cdo.server/pom.xml
+++ b/plugins/org.eclipse.emf.cdo.server/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo</groupId>
<artifactId>org.eclipse.emf.cdo.server</artifactId>
- <version>4.6.100-SNAPSHOT</version>
+ <version>4.7.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/StoreThreadLocal.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/StoreThreadLocal.java
index 0d00b367d6..9ba8a40731 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/StoreThreadLocal.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/StoreThreadLocal.java
@@ -109,6 +109,14 @@ public final class StoreThreadLocal
return accessor;
}
+ /**
+ * @since 4.7
+ */
+ public static boolean hasAccessor()
+ {
+ return ACCESSOR.get() != null;
+ }
+
public static void setCommitContext(IStoreAccessor.CommitContext commitContext)
{
if (commitContext == null)
@@ -127,6 +135,14 @@ public final class StoreThreadLocal
}
/**
+ * @since 4.7
+ */
+ public static boolean hasCommitContext()
+ {
+ return COMMIT_CONTEXT.get() != null;
+ }
+
+ /**
* @since 4.2
*/
public static void release()

Back to the top