From: rk Date: Wed, 6 Feb 2002 15:57:41 +0000 (+0000) Subject: count optimizaton moved X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=a8bebb13f13e29e33ba0ca72c5617d1e8527e4a9;p=mir.git count optimizaton moved --- diff --git a/source/mir/storage/Database.java b/source/mir/storage/Database.java index 575d3743..26e35c26 100755 --- a/source/mir/storage/Database.java +++ b/source/mir/storage/Database.java @@ -433,14 +433,16 @@ public class Database implements StorageObject { if (rs.next()) count = rs.getInt(1); rs.close(); + //nothing in the table: return null + if(count<=0){ + freeConnection(con, stmt); + return null; + } } else { - theLog.printError("Mh. Konnte nicht zaehlen: " + countSql); + theLog.printError("Could not count: " + countSql); } } - //nothing in the table: return null - if(count<=0){ - return null; - } + // hier select rs = executeSql(stmt, selectSql.toString()); if (rs != null) { @@ -1123,7 +1125,7 @@ public class Database implements StorageObject { void throwStorageObjectException (String message) throws StorageObjectException { _throwStorageObjectException(null, message); } - + }