From c672fb018483498ae2a01e404c969871f68c3243 Mon Sep 17 00:00:00 2001 From: mdb Date: Fri, 24 Aug 2007 01:13:27 +0000 Subject: [PATCH] More useful debug information. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2213 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../com/samskivert/jdbc/depot/FindAllQuery.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/java/com/samskivert/jdbc/depot/FindAllQuery.java b/src/java/com/samskivert/jdbc/depot/FindAllQuery.java index 46d634d8..ac45e42a 100644 --- a/src/java/com/samskivert/jdbc/depot/FindAllQuery.java +++ b/src/java/com/samskivert/jdbc/depot/FindAllQuery.java @@ -126,16 +126,18 @@ public abstract class FindAllQuery // and execute it try { ResultSet rs = stmt.executeQuery(); - int cnt = 0; + int cnt = 0, dups = 0; while (rs.next()) { T obj = _marsh.createObject(rs); - entities.put(_marsh.getPrimaryKey(obj), obj); - cnt ++; + if (entities.put(_marsh.getPrimaryKey(obj), obj) != null) { + dups++; + } + cnt++; } if (cnt != fetchKeys.size()) { - log.warning("Row count mismatch in second pass " + - "[expectedCount=" + fetchKeys.size() + - ", actualCount=" + cnt + "]"); + log.warning("Row count mismatch in second pass [query=" + stmt + + ", wanted=" + fetchKeys.size() + ", got=" + cnt + + ", dups=" + dups + "]"); } } finally {