]> source.dussan.org Git - sonarqube.git/commitdiff
Revert "SONAR-5605 MySQL: configure driver to use server side cursor and not client...
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Fri, 17 Oct 2014 06:29:01 +0000 (08:29 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Fri, 17 Oct 2014 06:29:01 +0000 (08:29 +0200)
This reverts commit ccf4726ae0530695bd55903a989bbd6afae1dd5c.

server/sonar-server/src/main/java/org/sonar/server/db/migrations/SelectImpl.java
sonar-application/src/main/assembly/conf/sonar.properties
sonar-application/src/main/java/org/sonar/application/JdbcSettings.java
sonar-application/src/test/java/org/sonar/application/JdbcSettingsTest.java

index d0724aaa8138ac7389eb07a4f30d0dc2ffb07855..b49fc88edee07aba640a4af55da644521cd3bd64 100644 (file)
@@ -21,6 +21,7 @@ package org.sonar.server.db.migrations;
 
 import org.apache.commons.dbutils.DbUtils;
 import org.sonar.core.persistence.Database;
+import org.sonar.core.persistence.dialect.MySql;
 
 import java.sql.Connection;
 import java.sql.PreparedStatement;
@@ -82,7 +83,11 @@ class SelectImpl extends BaseSqlStatement<Select> implements Select {
 
   static SelectImpl create(Database db, Connection connection, String sql) throws SQLException {
     PreparedStatement pstmt = connection.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
-    pstmt.setFetchSize(1000);
+    if (db.getDialect().getId().equals(MySql.ID)) {
+      pstmt.setFetchSize(Integer.MIN_VALUE);
+    } else {
+      pstmt.setFetchSize(1000);
+    }
     return new SelectImpl(pstmt);
   }
 }
index 064e2beafacad27ded1758e677c525936c71c86a..4c720ee9982871a2344d1b77957b02817d9254a1 100644 (file)
@@ -28,7 +28,7 @@
 
 
 #----- MySQL 5.x
-#sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useCursorFetch=true
+#sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
 
 
 #----- Oracle 10g/11g
index 2ce07111978b87010a5b650d8c6196a2d1b87d3d..20e32cacd02b25ff12ebaec62f3f763ef20161c3 100644 (file)
@@ -98,7 +98,6 @@ public class JdbcSettings {
     if (Provider.mysql.equals(provider)) {
       checkRequiredParameter(url, "useUnicode=true");
       checkRequiredParameter(url, "characterEncoding=utf8");
-      checkRequiredParameter(url, "useCursorFetch=true");
       checkRecommendedParameter(url, "rewriteBatchedStatements=true");
       checkRecommendedParameter(url, "useConfigs=maxPerformance");
     }
index e1cdeffa94e62380a9327b7a58d0c532e4bf54e6..ad603c4e45357e1382281296ae0870870d0ab84b 100644 (file)
@@ -64,11 +64,11 @@ public class JdbcSettingsTest {
 
     // minimal -> ok
     settings.checkUrlParameters(JdbcSettings.Provider.mysql,
-      "jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&useCursorFetch=true");
+      "jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8");
 
     // full -> ok
     settings.checkUrlParameters(JdbcSettings.Provider.mysql,
-      "jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useCursorFetch=true");
+      "jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance");
 
     // missing required -> ko
     try {