diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLBuffer.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLBuffer.java index 13d5bf3db..1249a3003 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLBuffer.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLBuffer.java @@ -594,7 +594,8 @@ public final class SQLBuffer setParameters(stmnt); if (fetch != null) { if (fetch.getFetchBatchSize() > 0) - stmnt.setFetchSize(fetch.getFetchBatchSize()); + stmnt.setFetchSize( + _dict.getBatchFetchSize(fetch.getFetchBatchSize())); if (rsType != ResultSet.TYPE_FORWARD_ONLY && fetch.getFetchDirection() != ResultSet.FETCH_FORWARD) stmnt.setFetchDirection(fetch.getFetchDirection()); diff --git a/openjpa-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestMySQLDictionary.java b/openjpa-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestMySQLDictionary.java index dc1721e45..5bf5fcbde 100644 --- a/openjpa-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestMySQLDictionary.java +++ b/openjpa-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestMySQLDictionary.java @@ -18,6 +18,7 @@ */ package org.apache.openjpa.jdbc.sql; +import java.sql.CallableStatement; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -33,10 +34,12 @@ public class TestMySQLDictionary extends MockObjectTestCase { assertEquals(Integer.MIN_VALUE, db.getBatchFetchSize(1)); } + + /** *
- * Ensure thaqt a connection obtained from a MySQLDictionary sets the
- * fetchBatchSize to Integer.MIN_VALUE
+ * Ensure that SQLBuffer.prepareStatement
calls
+ * setFetchSize(Integer.MIN_VALUE)
when using MySQL.
*
+ * Ensure that SQLBuffer.prepareCall()
calls
+ * setFetchSize(Integer.MIN_VALUE)
when using MySQL.
+ *