diff options
author | Eike Stepper | 2018-04-23 11:06:31 +0000 |
---|---|---|
committer | Eike Stepper | 2018-04-23 11:06:31 +0000 |
commit | 03800f7122fd19ca49170de208e97742a57047da (patch) | |
tree | a31ec908fbbb9ebb01c2faa9da67878b645ee9fb /plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo | |
parent | 5f582b20c8a4602fc0cc4f554e5098aa2cc7e8c9 (diff) | |
download | cdo-03800f7122fd19ca49170de208e97742a57047da.tar.gz cdo-03800f7122fd19ca49170de208e97742a57047da.tar.xz cdo-03800f7122fd19ca49170de208e97742a57047da.zip |
[405543] An unsettable many-valued reference that is set to an empty list is unset on new transaction
https://bugs.eclipse.org/bugs/show_bug.cgi?id=405543
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo')
11 files changed, 148 insertions, 106 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractBasicListTableMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractBasicListTableMapping.java index bbb8163fc6..c579cd8377 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractBasicListTableMapping.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractBasicListTableMapping.java @@ -252,10 +252,9 @@ public abstract class AbstractBasicListTableMapping implements IListMapping3, IM public void visit(CDOUnsetFeatureDelta delta) { - // TODO Shouldn't that be "!unsettable"?! - if (delta.getFeature().isUnsettable()) + if (!delta.getFeature().isUnsettable()) { - throw new IllegalArgumentException("Feature is unsettable: " + delta); + throw new IllegalArgumentException("Feature is not unsettable: " + delta); } if (TRACER.isEnabled()) diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractFeatureMapTableMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractFeatureMapTableMapping.java index e70bb8024f..f8889bc24c 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractFeatureMapTableMapping.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractFeatureMapTableMapping.java @@ -306,10 +306,16 @@ public abstract class AbstractFeatureMapTableMapping extends AbstractBasicListTa public void readValues(IDBStoreAccessor accessor, InternalCDORevision revision, int listChunk) { - MoveableList<Object> list = revision.getList(getFeature()); + MoveableList<Object> list = revision.getListOrNull(getFeature()); + if (list == null) + { + // Nothing to read take shortcut. + return; + } + if (listChunk == 0 || list.size() == 0) { - // nothing to read take shortcut + // Nothing to read take shortcut. return; } @@ -464,12 +470,14 @@ public abstract class AbstractFeatureMapTableMapping extends AbstractBasicListTa public void writeValues(IDBStoreAccessor accessor, InternalCDORevision revision) { - CDOList values = revision.getList(getFeature()); - - int idx = 0; - for (Object element : values) + CDOList values = revision.getListOrNull(getFeature()); + if (values != null) { - writeValue(accessor, revision, idx++, element); + int idx = 0; + for (Object element : values) + { + writeValue(accessor, revision, idx++, element); + } } } 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 cb0d7519f7..f885e7a5d4 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 @@ -70,8 +70,6 @@ import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.util.FeatureMapUtil; -import org.eclipse.core.runtime.Assert; - import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; @@ -91,6 +89,8 @@ import java.util.Set; */ public abstract class AbstractHorizontalClassMapping implements IClassMapping, IMappingConstants, IDeactivateable { + protected static final int UNSET_LIST = -1; + private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, AbstractHorizontalClassMapping.class); private EClass eClass; @@ -455,19 +455,19 @@ public abstract class AbstractHorizontalClassMapping implements IClassMapping, I { EStructuralFeature feature = listSizeEntry.getKey(); IDBField field = listSizeEntry.getValue(); - int size = resultSet.getInt(field.getName()); - // ensure the listSize (TODO: remove assertion) - CDOList list = revision.getList(feature, size); - - for (int i = 0; i < size; i++) + int size = resultSet.getInt(field.getName()); + if (size == UNSET_LIST) { - list.add(InternalCDOList.UNINITIALIZED); + // Leave the list slot in the revision null. + continue; } - if (list.size() != size) + // Ensure the list size. + CDOList list = revision.getOrCreateList(feature, size); + for (int i = 0; i < size; i++) { - Assert.isTrue(false); + list.add(InternalCDOList.UNINITIALIZED); } } } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractListTableMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractListTableMapping.java index 901c0cdfee..07778bef59 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractListTableMapping.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractListTableMapping.java @@ -233,9 +233,14 @@ public abstract class AbstractListTableMapping extends AbstractBasicListTableMap public void readValues(IDBStoreAccessor accessor, InternalCDORevision revision, int listChunk) { - MoveableList<Object> list = revision.getList(getFeature()); + if (listChunk == 0) + { + // Nothing to read. Take shortcut. + return; + } - if (listChunk == 0 || list.size() == 0) + MoveableList<Object> list = revision.getListOrNull(getFeature()); + if (list == null || list.size() == 0) { // Nothing to read. Take shortcut. return; @@ -391,12 +396,14 @@ public abstract class AbstractListTableMapping extends AbstractBasicListTableMap public void writeValues(IDBStoreAccessor accessor, InternalCDORevision revision) { - CDOList values = revision.getList(getFeature()); - - int idx = 0; - for (Object element : values) + CDOList values = revision.getListOrNull(getFeature()); + if (values != null) { - writeValue(accessor, revision, idx++, element); + int idx = 0; + for (Object element : values) + { + writeValue(accessor, revision, idx++, element); + } } } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AuditFeatureMapTableMappingWithRanges.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AuditFeatureMapTableMappingWithRanges.java index 1567dd5a94..77c6a46f0e 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AuditFeatureMapTableMappingWithRanges.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AuditFeatureMapTableMappingWithRanges.java @@ -389,10 +389,16 @@ public class AuditFeatureMapTableMappingWithRanges extends AbstractBasicListTabl public void readValues(IDBStoreAccessor accessor, InternalCDORevision revision, int listChunk) { - MoveableList<Object> list = revision.getList(getFeature()); + MoveableList<Object> list = revision.getListOrNull(getFeature()); + if (list == null) + { + // Nothing to read take shortcut. + return; + } + if (listChunk == 0 || list.size() == 0) { - // nothing to read take shortcut + // Nothing to read take shortcut. return; } @@ -553,17 +559,19 @@ public class AuditFeatureMapTableMappingWithRanges extends AbstractBasicListTabl public void writeValues(IDBStoreAccessor accessor, InternalCDORevision revision) { - CDOList values = revision.getList(getFeature()); - - int idx = 0; - for (Object element : values) + CDOList values = revision.getListOrNull(getFeature()); + if (values != null) { - writeValue(accessor, revision, idx++, element); - } + int idx = 0; + for (Object element : values) + { + writeValue(accessor, revision, idx++, element); + } - if (TRACER.isEnabled()) - { - TRACER.format("Writing done"); //$NON-NLS-1$ + if (TRACER.isEnabled()) + { + TRACER.format("Writing done"); //$NON-NLS-1$ + } } } @@ -712,7 +720,7 @@ public class AuditFeatureMapTableMappingWithRanges extends AbstractBasicListTabl InternalCDORevision originalRevision = (InternalCDORevision)repo.getRevisionManager().getRevision(id, repo.getBranchManager().getMainBranch().getHead(), /* chunksize = */0, CDORevision.DEPTH_NONE, true); - int oldListSize = originalRevision.getList(getFeature()).size(); + int oldListSize = originalRevision.size(getFeature()); if (TRACER.isEnabled()) { @@ -757,7 +765,7 @@ public class AuditFeatureMapTableMappingWithRanges extends AbstractBasicListTabl id = this.originalRevision.getID(); this.oldVersion = oldVersion; this.newVersion = newVersion; - lastIndex = originalRevision.getList(getFeature()).size() - 1; + lastIndex = originalRevision.size(getFeature()) - 1; this.timestamp = timestamp; } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AuditListTableMappingWithRanges.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AuditListTableMappingWithRanges.java index a3d6b6720b..ac85dac311 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AuditListTableMappingWithRanges.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AuditListTableMappingWithRanges.java @@ -314,10 +314,16 @@ public class AuditListTableMappingWithRanges extends AbstractBasicListTableMappi public void readValues(IDBStoreAccessor accessor, InternalCDORevision revision, int listChunk) { - MoveableList<Object> list = revision.getList(getFeature()); + MoveableList<Object> list = revision.getListOrNull(getFeature()); + if (list == null) + { + // Nothing to read take shortcut. + return; + } + if (listChunk == 0 || list.size() == 0) { - // nothing to read take shortcut + // Nothing to read take shortcut. return; } @@ -463,17 +469,19 @@ public class AuditListTableMappingWithRanges extends AbstractBasicListTableMappi public void writeValues(IDBStoreAccessor accessor, InternalCDORevision revision) { - CDOList values = revision.getList(getFeature()); - - int idx = 0; - for (Object element : values) + CDOList values = revision.getListOrNull(getFeature()); + if (values != null) { - writeValue(accessor, revision, idx++, element); - } + int idx = 0; + for (Object element : values) + { + writeValue(accessor, revision, idx++, element); + } - if (TRACER.isEnabled()) - { - TRACER.format("Writing done"); //$NON-NLS-1$ + if (TRACER.isEnabled()) + { + TRACER.format("Writing done"); //$NON-NLS-1$ + } } } @@ -545,8 +553,8 @@ public class AuditListTableMappingWithRanges extends AbstractBasicListTableMappi CDOBranch main = getMappingStrategy().getStore().getRepository().getBranchManager().getMainBranch(); // get revision from cache to find out version number - CDORevision revision = getMappingStrategy().getStore().getRepository().getRevisionManager().getRevision(id, main.getHead(), - /* chunksize = */0, CDORevision.DEPTH_NONE, true); + CDORevision revision = getMappingStrategy().getStore().getRepository().getRevisionManager().getRevision(id, main.getHead(), /* chunksize = */0, + CDORevision.DEPTH_NONE, true); // set cdo_revision_removed for all list items (so we have no NULL values) clearList(accessor, id, revision.getVersion(), FINAL_VERSION); @@ -817,7 +825,7 @@ public class AuditListTableMappingWithRanges extends AbstractBasicListTableMappi InternalCDORevision originalRevision = (InternalCDORevision)repo.getRevisionManager().getRevision(id, repo.getBranchManager().getMainBranch().getHead(), /* chunksize = */0, CDORevision.DEPTH_NONE, true); - int oldListSize = originalRevision.getList(getFeature()).size(); + int oldListSize = originalRevision.size(getFeature()); if (TRACER.isEnabled()) { @@ -864,7 +872,7 @@ public class AuditListTableMappingWithRanges extends AbstractBasicListTableMappi id = originalRevision.getID(); this.oldVersion = oldVersion; this.newVersion = newVersion; - lastIndex = originalRevision.getList(getFeature()).size() - 1; + lastIndex = originalRevision.size(getFeature()) - 1; lastRemovedIndex = -1; } @@ -975,11 +983,6 @@ public class AuditListTableMappingWithRanges extends AbstractBasicListTableMappi public void visit(CDOUnsetFeatureDelta delta) { - if (delta.getFeature().isUnsettable()) - { - throw new ImplementationError("Should not be called"); //$NON-NLS-1$ - } - if (TRACER.isEnabled()) { TRACER.format("Delta Unsetting"); //$NON-NLS-1$ diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingFeatureMapTableMappingWithRanges.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingFeatureMapTableMappingWithRanges.java index 8cc6faab63..6a02a748c8 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingFeatureMapTableMappingWithRanges.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingFeatureMapTableMappingWithRanges.java @@ -394,7 +394,13 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList public void readValues(IDBStoreAccessor accessor, InternalCDORevision revision, int listChunk) { - MoveableList<Object> list = revision.getList(getFeature()); + MoveableList<Object> list = revision.getListOrNull(getFeature()); + if (list == null) + { + // Nothing to read take shortcut. + return; + } + int valuesToRead = list.size(); if (listChunk != CDORevision.UNCHUNKED && listChunk < valuesToRead) @@ -404,7 +410,7 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList if (valuesToRead == 0) { - // nothing to read take shortcut + // Nothing to read take shortcut. return; } @@ -680,17 +686,19 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList public void writeValues(IDBStoreAccessor accessor, InternalCDORevision revision) { - CDOList values = revision.getList(getFeature()); - - int idx = 0; - for (Object element : values) + CDOList values = revision.getListOrNull(getFeature()); + if (values != null) { - writeValue(accessor, revision, idx++, element); - } + int idx = 0; + for (Object element : values) + { + writeValue(accessor, revision, idx++, element); + } - if (TRACER.isEnabled()) - { - TRACER.format("Writing done"); //$NON-NLS-1$ + if (TRACER.isEnabled()) + { + TRACER.format("Writing done"); //$NON-NLS-1$ + } } } @@ -830,7 +838,7 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList TRACER.format("objectDetached {1}", revision); //$NON-NLS-1$ } - clearList(accessor, id, branchId, revision.getVersion(), FINAL_VERSION, revision.getList(getFeature()).size() - 1, revised); + clearList(accessor, id, branchId, revision.getVersion(), FINAL_VERSION, revision.size(getFeature()) - 1, revised); } @Override @@ -850,7 +858,7 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList } InternalCDORevision originalRevision = (InternalCDORevision)accessor.getTransaction().getRevision(id); - int oldListSize = originalRevision.getList(getFeature()).size(); + int oldListSize = originalRevision.size(getFeature()); if (TRACER.isEnabled()) { @@ -911,7 +919,7 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList branchID = targetBranchID; this.oldVersion = oldVersion; this.newVersion = newVersion; - lastIndex = originalRevision.getList(getFeature()).size() - 1; + lastIndex = originalRevision.size(getFeature()) - 1; this.timestamp = timestamp; } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingListTableMappingWithRanges.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingListTableMappingWithRanges.java index 24e18cac26..aac4f79ff2 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingListTableMappingWithRanges.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingListTableMappingWithRanges.java @@ -296,7 +296,13 @@ public class BranchingListTableMappingWithRanges extends AbstractBasicListTableM public void readValues(IDBStoreAccessor accessor, InternalCDORevision revision, final int listChunk) { - MoveableList<Object> list = revision.getList(getFeature()); + MoveableList<Object> list = revision.getListOrNull(getFeature()); + if (list == null) + { + // Nothing to read take shortcut. + return; + } + int valuesToRead = list.size(); if (listChunk != CDORevision.UNCHUNKED && listChunk < valuesToRead) { @@ -305,7 +311,7 @@ public class BranchingListTableMappingWithRanges extends AbstractBasicListTableM if (valuesToRead == 0) { - // nothing to read take shortcut + // Nothing to read take shortcut. return; } @@ -610,17 +616,19 @@ public class BranchingListTableMappingWithRanges extends AbstractBasicListTableM public void writeValues(IDBStoreAccessor accessor, InternalCDORevision revision) { - CDOList values = revision.getList(getFeature()); - - int idx = 0; - for (Object element : values) + CDOList values = revision.getListOrNull(getFeature()); + if (values != null) { - writeValue(accessor, revision, idx++, element); - } + int idx = 0; + for (Object element : values) + { + writeValue(accessor, revision, idx++, element); + } - if (TRACER.isEnabled()) - { - TRACER.format("Writing done"); //$NON-NLS-1$ + if (TRACER.isEnabled()) + { + TRACER.format("Writing done"); //$NON-NLS-1$ + } } } @@ -698,7 +706,7 @@ public class BranchingListTableMappingWithRanges extends AbstractBasicListTableM int branchID = transaction.getBranch().getID(); int version = revision.getVersion(); - int lastIndex = revision.getList(getFeature()).size() - 1; + int lastIndex = revision.size(getFeature()) - 1; clearList(accessor, id, branchID, version, FINAL_VERSION, lastIndex); } @@ -720,7 +728,7 @@ public class BranchingListTableMappingWithRanges extends AbstractBasicListTableM } InternalCDORevision originalRevision = (InternalCDORevision)accessor.getTransaction().getRevision(id); - int oldListSize = originalRevision.getList(getFeature()).size(); + int oldListSize = originalRevision.size(getFeature()); if (TRACER.isEnabled()) { @@ -784,7 +792,7 @@ public class BranchingListTableMappingWithRanges extends AbstractBasicListTableM branchID = targetBranchID; this.oldVersion = oldVersion; this.newVersion = newVersion; - lastIndex = originalRevision.getList(getFeature()).size() - 1; + lastIndex = originalRevision.size(getFeature()) - 1; lastRemovedIndex = -1; } @@ -844,11 +852,6 @@ public class BranchingListTableMappingWithRanges extends AbstractBasicListTableM public void visit(CDOUnsetFeatureDelta delta) { - if (delta.getFeature().isUnsettable()) - { - throw new ImplementationError("Should not be called"); //$NON-NLS-1$ - } - if (TRACER.isEnabled()) { TRACER.format("Delta Unsetting"); //$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 873c9fe97a..8859f45065 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 @@ -487,8 +487,9 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping for (EStructuralFeature feature : listSizeFields.keySet()) { - CDOList list = revision.getList(feature); - stmt.setInt(column++, list.size()); + CDOList list = revision.getListOrNull(feature); + int size = list == null ? UNSET_LIST : list.size(); + stmt.setInt(column++, size); } } @@ -867,16 +868,19 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping IListMappingUnitSupport listMapping = listMappings[i]; EStructuralFeature feature = listMapping.getFeature(); - MoveableList<Object> list = revision.getList(feature); - int size = list.size(); - if (size != 0) + MoveableList<Object> list = revision.getListOrNull(feature); + if (list != null) { - if (resultSets[i] == null) + int size = list.size(); + if (size != 0) { - resultSets[i] = listMapping.queryUnitEntries(accessor, idHandler, timeStamp, rootID); - } + if (resultSets[i] == null) + { + resultSets[i] = listMapping.queryUnitEntries(accessor, idHandler, timeStamp, rootID); + } - listMapping.readUnitEntries(resultSets[i], idHandler, id, list); + listMapping.readUnitEntries(resultSets[i], idHandler, id, list); + } } } 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 f77135abcd..d4d1d36aef 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 @@ -463,8 +463,9 @@ public class HorizontalBranchingClassMapping extends AbstractHorizontalClassMapp for (EStructuralFeature feature : listSizeFields.keySet()) { - CDOList list = revision.getList(feature); - stmt.setInt(column++, list.size()); + CDOList list = revision.getListOrNull(feature); + int size = list == null ? UNSET_LIST : list.size(); + stmt.setInt(column++, size); } } 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 5bf405e926..be80e65c78 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 @@ -240,8 +240,9 @@ public class HorizontalNonAuditClassMapping extends AbstractHorizontalClassMappi for (EStructuralFeature feature : listSizeFields.keySet()) { - CDOList list = revision.getList(feature); - stmt.setInt(column++, list.size()); + CDOList list = revision.getListOrNull(feature); + int size = list == null ? UNSET_LIST : list.size(); + stmt.setInt(column++, size); } } |