summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-01-07 04:39:33 (EST)
committerEike Stepper2008-01-07 04:39:33 (EST)
commit5561abf67960246706486eb0f9c96cd59b860194 (patch)
tree319d8618001b3b47c5e8ab853dcd914379278bea
parent404477aba55888996f82e78e6a4f5624696916f0 (diff)
downloadcdo-5561abf67960246706486eb0f9c96cd59b860194.zip
cdo-5561abf67960246706486eb0f9c96cd59b860194.tar.gz
cdo-5561abf67960246706486eb0f9c96cd59b860194.tar.bz2
[214459] Crash recovery occurs without crash
https://bugs.eclipse.org/bugs/show_bug.cgi?id=214459
-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 cd0df15..677654f 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 03c6a8e..2ff53cd 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