]> source.dussan.org Git - sonarqube.git/commitdiff
change MyBatis session cache to statement cache
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Fri, 14 Oct 2016 08:55:44 +0000 (10:55 +0200)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Wed, 19 Oct 2016 12:45:13 +0000 (14:45 +0200)
sonar-db/src/main/java/org/sonar/db/MyBatisConfBuilder.java

index 2e53d95974983c60ae12e740ff88d21561905095..d48da941452acccc923a0761e28b5b82215321e9 100644 (file)
@@ -24,6 +24,7 @@ import java.io.InputStream;
 import org.apache.ibatis.builder.xml.XMLMapperBuilder;
 import org.apache.ibatis.mapping.Environment;
 import org.apache.ibatis.session.Configuration;
+import org.apache.ibatis.session.LocalCacheScope;
 import org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory;
 import org.apache.ibatis.type.JdbcType;
 import org.sonar.api.utils.log.LoggerLevel;
@@ -47,6 +48,7 @@ public final class MyBatisConfBuilder {
     this.conf.getVariables().setProperty("_true", dialect.getTrueSqlValue());
     this.conf.getVariables().setProperty("_false", dialect.getFalseSqlValue());
     this.conf.getVariables().setProperty("_scrollFetchSize", String.valueOf(dialect.getScrollDefaultFetchSize()));
+    this.conf.setLocalCacheScope(LocalCacheScope.STATEMENT);
   }
 
   public void loadAlias(String alias, Class dtoClass) {