More useful debug information.

This commit is contained in:
Michael Bayne
2007-08-24 01:13:27 +00:00
parent cd6410ad7d
commit b24786facd
@@ -126,16 +126,18 @@ public abstract class FindAllQuery<T extends PersistentRecord>
// and execute it // and execute it
try { try {
ResultSet rs = stmt.executeQuery(); ResultSet rs = stmt.executeQuery();
int cnt = 0; int cnt = 0, dups = 0;
while (rs.next()) { while (rs.next()) {
T obj = _marsh.createObject(rs); T obj = _marsh.createObject(rs);
entities.put(_marsh.getPrimaryKey(obj), obj); if (entities.put(_marsh.getPrimaryKey(obj), obj) != null) {
cnt ++; dups++;
}
cnt++;
} }
if (cnt != fetchKeys.size()) { if (cnt != fetchKeys.size()) {
log.warning("Row count mismatch in second pass " + log.warning("Row count mismatch in second pass [query=" + stmt +
"[expectedCount=" + fetchKeys.size() + ", wanted=" + fetchKeys.size() + ", got=" + cnt +
", actualCount=" + cnt + "]"); ", dups=" + dups + "]");
} }
} finally { } finally {