Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java9
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java4
2 files changed, 6 insertions, 7 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 cd0df15332..677654fd79 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
@@ -196,9 +196,9 @@ public class DBStore extends Store implements IDBStore
else
{
// Restart
- int nextCDOID = DBUtil.selectMaximumInt(connection, CDODBSchema.REPOSITORY_NEXT_CDOID);
- int nextMetaID = DBUtil.selectMaximumInt(connection, CDODBSchema.REPOSITORY_NEXT_METAID);
- if (nextCDOID == 0 || nextMetaID == 0)
+ long nextCDOID = DBUtil.selectMaximumLong(connection, CDODBSchema.REPOSITORY_NEXT_CDOID);
+ long nextMetaID = DBUtil.selectMaximumLong(connection, CDODBSchema.REPOSITORY_NEXT_METAID);
+ if (nextCDOID == 0L || nextMetaID == 0L)
{
OM.LOG.warn("Detected restart after crash");
}
@@ -241,6 +241,7 @@ public class DBStore extends Store implements IDBStore
protected void deactivateStore(Repository repository, Connection connection)
{
+ LifecycleUtil.deactivate(mappingStrategy);
StringBuilder builder = new StringBuilder();
builder.append("UPDATE ");
builder.append(CDODBSchema.REPOSITORY);
@@ -263,8 +264,6 @@ public class DBStore extends Store implements IDBStore
{
throw new DBException("No row updated in table " + CDODBSchema.REPOSITORY);
}
-
- LifecycleUtil.deactivate(mappingStrategy);
}
public void repairAfterCrash()
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java
index 03c6a8eed4..2ff53cdb6d 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java
@@ -145,7 +145,7 @@ public final class DBUtil
return (Integer)number;
}
- return 0;
+ throw new DBException("Not an integer number: " + number);
}
public static long selectMaximumLong(Connection connection, IDBField field) throws DBException
@@ -156,7 +156,7 @@ public final class DBUtil
return (Long)number;
}
- return 0;
+ throw new DBException("Not a long number: " + number);
}
private static Number getMaximumNumber(Connection connection, IDBField field) throws DBException

Back to the top