diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-10-31 09:24:49 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-10-31 09:54:23 +0100 |
commit | 76b88cf1f5f42d331ad02df55a083325226c6224 (patch) | |
tree | 7619af3ef716fa9988fc8709e8f4f2abcb7d474b /server | |
parent | 52984980526070a1940608fc250cc2e09ed2ddab (diff) | |
download | sonarqube-76b88cf1f5f42d331ad02df55a083325226c6224.tar.gz sonarqube-76b88cf1f5f42d331ad02df55a083325226c6224.zip |
SONAR-5606 refactor MyBatis configuration of result set scrolling
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/db/migrations/SelectImpl.java | 7 | ||||
-rw-r--r-- | server/sonar-server/src/test/resources/org/sonar/server/db/fake/FakeMapper.xml | 2 |
2 files changed, 2 insertions, 7 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/db/migrations/SelectImpl.java b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/SelectImpl.java index b49fc88edee..11243866258 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/db/migrations/SelectImpl.java +++ b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/SelectImpl.java @@ -21,7 +21,6 @@ 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; @@ -83,11 +82,7 @@ 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); - if (db.getDialect().getId().equals(MySql.ID)) { - pstmt.setFetchSize(Integer.MIN_VALUE); - } else { - pstmt.setFetchSize(1000); - } + pstmt.setFetchSize(db.getDialect().getScrollDefaultFetchSize()); return new SelectImpl(pstmt); } } diff --git a/server/sonar-server/src/test/resources/org/sonar/server/db/fake/FakeMapper.xml b/server/sonar-server/src/test/resources/org/sonar/server/db/fake/FakeMapper.xml index 3ab38789b2d..ade40876332 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/db/fake/FakeMapper.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/db/fake/FakeMapper.xml @@ -21,7 +21,7 @@ values (#{key}, #{createdAt}, #{updatedAt}) </insert> - <select id="selectAfterDate" resultType="fake" resultSetType="FORWARD_ONLY" fetchSize="200"> + <select id="selectAfterDate" resultType="fake" fetchSize="${_scrollFetchSize}" resultSetType="FORWARD_ONLY"> select <include refid="selectColumns"/> from fake f |