summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-09-14 12:59:35 (EDT)
committerEike Stepper2007-09-14 12:59:35 (EDT)
commit6fc86bcb6130a313765376acc6ef2cccbc2ca7d1 (patch)
tree66e903d92ad1ca83befb3ab6b81ea4c4d559650c
parentcdd3083cb42681b10124f68b83f4444f883a7226 (diff)
downloadcdo-6fc86bcb6130a313765376acc6ef2cccbc2ca7d1.zip
cdo-6fc86bcb6130a313765376acc6ef2cccbc2ca7d1.tar.gz
cdo-6fc86bcb6130a313765376acc6ef2cccbc2ca7d1.tar.bz2
[202833] Horizontal Mapping Strategy
https://bugs.eclipse.org/bugs/show_bug.cgi?id=202833
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java19
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java5
2 files changed, 21 insertions, 3 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java
index 8bf7372..eb06984 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java
@@ -192,8 +192,17 @@ public class DBStore extends Store implements IDBStore
else
{
// Restart
- repository.setNextOIDValue(DBUtil.selectMaximum(connection, CDODBSchema.REPOSITORY_NEXT_CDOID));
- repository.setNextMetaIDValue(DBUtil.selectMaximum(connection, CDODBSchema.REPOSITORY_NEXT_METAID));
+ int stopped = DBUtil.selectMaximum(connection, CDODBSchema.REPOSITORY_STOPPED);
+ if (stopped == 0)
+ {
+ repairAfterCrash(repository, connection);
+ }
+
+ int nextCDOID = DBUtil.selectMaximum(connection, CDODBSchema.REPOSITORY_NEXT_CDOID);
+ int nextMetaID = DBUtil.selectMaximum(connection, CDODBSchema.REPOSITORY_NEXT_METAID);
+
+ repository.setNextOIDValue(nextCDOID);
+ repository.setNextMetaIDValue(nextMetaID);
StringBuilder builder = new StringBuilder();
builder.append("UPDATE ");
@@ -253,6 +262,12 @@ public class DBStore extends Store implements IDBStore
}
}
+ protected void repairAfterCrash(Repository repository, Connection connection)
+ {
+ // TODO Implement method DBStore.repairAfterCrash()
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
protected IDBSchema createSchema()
{
String name = getRepository().getName();
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 a9af71d..7f35adf 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,7 +57,10 @@ public class HorizontalMappingStrategy extends MappingStrategy
{
for (CDOClass cdoClass : cdoPackage.getConcreteClasses())
{
- result.add(cdoClass);
+ if (!cdoClass.isRoot())
+ {
+ result.add(cdoClass);
+ }
}
}