summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-01-17 13:18:08 (EST)
committerEike Stepper2008-01-17 13:18:08 (EST)
commite3305e50733fdae0ab6bf8d3e1581122029deb60 (patch)
tree546446670b9cc5e760d5cacabfd62e36aa01801d
parent37cf629f28d73ed1433c53431062787c124b3ede (diff)
downloadcdo-e3305e50733fdae0ab6bf8d3e1581122029deb60.zip
cdo-e3305e50733fdae0ab6bf8d3e1581122029deb60.tar.gz
cdo-e3305e50733fdae0ab6bf8d3e1581122029deb60.tar.bz2
[215686] Object type for CODID 2 not found
https://bugs.eclipse.org/bugs/show_bug.cgi?id=215686
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreReader.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ObjectTypeCache.java2
3 files changed, 6 insertions, 13 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreReader.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreReader.java
index 021646e..6798dc4 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreReader.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreReader.java
@@ -212,9 +212,10 @@ public class DBStoreReader extends DBStoreAccessor implements IDBStoreReader
public CDOClassRef readClassRef(int classID)
{
String where = CDODBSchema.CLASSES_ID.getName() + "=" + classID;
- Object[] ids = DBUtil.select(getConnection(), where, CDODBSchema.CLASSES_CLASSIFIER, CDODBSchema.CLASSES_PACKAGE);
- String packageURI = readPackageURI((Integer)ids[1]);
- return new CDOClassRefImpl(packageURI, (Integer)ids[0]);
+ Object[] res = DBUtil.select(getConnection(), where, CDODBSchema.CLASSES_CLASSIFIER, CDODBSchema.CLASSES_PACKAGE);
+ int classifierID = (Integer)res[0];
+ String packageURI = readPackageURI((Integer)res[1]);
+ return new CDOClassRefImpl(packageURI, classifierID);
}
public CDORevision readRevision(CDOID id, int referenceChunk)
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java
index 8a3cc0a..03c4a1e 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java
@@ -57,15 +57,7 @@ public class HorizontalMappingStrategy extends MappingStrategy
public CDOClassRef readObjectType(IDBStoreReader storeReader, CDOID id)
{
- CDOClassRef type = objectTypeCache.getObjectType(storeReader, id);
- if (type == null)
- {
- throw new DBException("Type of " + id + " not found");
- // type = readObjectTypeFromClassesWithObjectInfo(storeReader, id);
- // objectTypeCache.putObjectType(storeReader.getStatement(), id, type);
- }
-
- return type;
+ return objectTypeCache.getObjectType(storeReader, id);
}
protected CDOClassRef readObjectTypeFromClassesWithObjectInfo(IDBStoreReader storeReader, CDOID id)
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ObjectTypeCache.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ObjectTypeCache.java
index fb68f16..2c28989 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ObjectTypeCache.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ObjectTypeCache.java
@@ -84,7 +84,7 @@ public class ObjectTypeCache extends Lifecycle implements IObjectTypeCache
resultSet = statement.executeQuery(sql);
if (!resultSet.next())
{
- return null;
+ throw new DBException("ClassID for CDOID " + id + " not found");
}
int classID = resultSet.getInt(1);