summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-01-17 12:10:18 (EST)
committerEike Stepper2008-01-17 12:10:18 (EST)
commit37cf629f28d73ed1433c53431062787c124b3ede (patch)
tree1c04014ff1e468768fc86b0424da4ef49285717a
parentdd511930a3075d917b4c744277ffa6d34c9050a3 (diff)
downloadcdo-37cf629f28d73ed1433c53431062787c124b3ede.zip
cdo-37cf629f28d73ed1433c53431062787c124b3ede.tar.gz
cdo-37cf629f28d73ed1433c53431062787c124b3ede.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/MappingStrategy.java10
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java8
2 files changed, 13 insertions, 5 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MappingStrategy.java
index a324bf8..3c9943d 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MappingStrategy.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MappingStrategy.java
@@ -361,22 +361,22 @@ public abstract class MappingStrategy extends Lifecycle implements IMappingStrat
public long repairAfterCrash(Connection connection)
{
- long max = 0L;
+ long maxCDOID = 0L;
for (CDOClass idClass : getClassesWithObjectInfo())
{
IClassMapping classMapping = getClassMapping(idClass);
IDBTable table = classMapping.getTable();
IDBField idField = table.getField(CDODBSchema.ATTRIBUTES_ID);
- long classMax = DBUtil.selectMaximumLong(connection, idField);
+ long classMaxCDOID = DBUtil.selectMaximumLong(connection, idField);
if (TRACER.isEnabled())
{
- TRACER.format("Max CDOID of table {0}: {1}", table, classMax);
+ TRACER.format("Max CDOID of table {0}: {1}", table, classMaxCDOID);
}
- max = Math.max(max, classMax);
+ maxCDOID = Math.max(maxCDOID, classMaxCDOID);
}
- return max + 2L;
+ return maxCDOID + 2L;
}
@Override
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 52ec022..e9c2660 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
@@ -147,6 +147,10 @@ public final class DBUtil
{
return (Integer)number;
}
+ else if (number == null)
+ {
+ return 0;
+ }
throw new DBException("Not an integer number: " + number);
}
@@ -158,6 +162,10 @@ public final class DBUtil
{
return (Long)number;
}
+ else if (number == null)
+ {
+ return 0L;
+ }
throw new DBException("Not a long number: " + number);
}