jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1178892 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionHelper.java
Date Tue, 04 Oct 2011 18:26:21 GMT
Author: jukka
Date: Tue Oct  4 18:26:21 2011
New Revision: 1178892

URL: http://svn.apache.org/viewvc?rev=1178892&view=rev
Log:
JCR-3090: setFetchSize() fails in getAllNodeIds()

Avoid problems when maxRows == 0

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionHelper.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionHelper.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionHelper.java?rev=1178892&r1=1178891&r2=1178892&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionHelper.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionHelper.java
Tue Oct  4 18:26:21 2011
@@ -369,7 +369,11 @@ public class ConnectionHelper {
                 stmt = con.prepareStatement(sql);
             }
             stmt.setMaxRows(maxRows);
-            stmt.setFetchSize(Math.min(10000, maxRows));
+            int fetchSize = 10000;
+            if (0 < maxRows && maxRows < fetchSize) {
+                fetchSize = maxRows; // JCR-3090
+            }
+            stmt.setFetchSize(fetchSize);
             execute(stmt, params);
             if (returnGeneratedKeys) {
                 rs = stmt.getGeneratedKeys();



Mime
View raw message