]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5828 Fix default value of property sonar.jdbc.maxActive
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 4 Nov 2014 22:14:20 +0000 (23:14 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 4 Nov 2014 22:22:39 +0000 (23:22 +0100)
server/sonar-process/src/main/java/org/sonar/process/ProcessConstants.java
sonar-application/src/main/assembly/conf/sonar.properties
sonar-application/src/main/java/org/sonar/application/DefaultSettings.java
sonar-application/src/test/java/org/sonar/application/DefaultSettingsTest.java

index 2d1a524e3fc7a9bb1536543116a10753a00d3c75..7c33816255e557200759c78f2f9b7c1508ab2a2c 100644 (file)
@@ -35,6 +35,12 @@ public interface ProcessConstants {
   String JDBC_LOGIN = "sonar.jdbc.username";
   String JDBC_PASSWORD = "sonar.jdbc.password";
   String JDBC_DRIVER_PATH = "sonar.jdbc.driverPath";
+  String JDBC_MAX_ACTIVE = "sonar.jdbc.maxActive";
+  String JDBC_MAX_IDLE = "sonar.jdbc.maxIdle";
+  String JDBC_MIN_IDLE = "sonar.jdbc.minIdle";
+  String JDBC_MAX_WAIT = "sonar.jdbc.maxWait";
+  String JDBC_MIN_EVICTABLE_IDLE_TIME_MILLIS = "sonar.jdbc.minEvictableIdleTimeMillis";
+  String JDBC_TIME_BETWEEN_EVICTION_RUNS_MILLIS = "sonar.jdbc.timeBetweenEvictionRunsMillis";
 
   String PATH_DATA = "sonar.path.data";
   String PATH_HOME = "sonar.path.home";
index 4c720ee9982871a2344d1b77957b02817d9254a1..ba48400d9f34600298b61ca52e8b05adc7a456af 100644 (file)
 
 
 #----- Connection pool settings
-sonar.jdbc.maxActive=20
-sonar.jdbc.maxIdle=5
-sonar.jdbc.minIdle=2
-sonar.jdbc.maxWait=5000
-sonar.jdbc.minEvictableIdleTimeMillis=600000
-sonar.jdbc.timeBetweenEvictionRunsMillis=30000
+# The maximum number of active connections that can be allocated
+# at the same time, or negative for no limit.
+#sonar.jdbc.maxActive=50
+
+# The maximum number of connections that can remain idle in the
+# pool, without extra ones being released, or negative for no limit.
+#sonar.jdbc.maxIdle=5
+
+# The minimum number of connections that can remain idle in the pool,
+# without extra ones being created, or zero to create none.
+#sonar.jdbc.minIdle=2
+
+# The maximum number of milliseconds that the pool will wait (when there
+# are no available connections) for a connection to be returned before
+# throwing an exception, or <= 0 to wait indefinitely.
+#sonar.jdbc.maxWait=5000
+
+#sonar.jdbc.minEvictableIdleTimeMillis=600000
+#sonar.jdbc.timeBetweenEvictionRunsMillis=30000
 
 
 
index cfb395a8f8b43daa9c5f92cdb61c286ff170cfd7..ede244379cfdb6e6ecc258a925db2ae9c8bf55a0 100644 (file)
@@ -68,6 +68,12 @@ class DefaultSettings {
     defaults.put(ProcessConstants.JDBC_URL, "jdbc:h2:tcp://localhost:9092/sonar");
     defaults.put(ProcessConstants.JDBC_LOGIN, "sonar");
     defaults.put(ProcessConstants.JDBC_PASSWORD, "sonar");
+    defaults.put(ProcessConstants.JDBC_MAX_ACTIVE, "50");
+    defaults.put(ProcessConstants.JDBC_MAX_IDLE, "5");
+    defaults.put(ProcessConstants.JDBC_MIN_IDLE, "2");
+    defaults.put(ProcessConstants.JDBC_MAX_WAIT, "5000");
+    defaults.put(ProcessConstants.JDBC_MIN_EVICTABLE_IDLE_TIME_MILLIS, "600000");
+    defaults.put(ProcessConstants.JDBC_TIME_BETWEEN_EVICTION_RUNS_MILLIS, "30000");
     return defaults;
   }
 
index 82969821f62324a921accb55395be6ac1a199b9b..317c6fd7f0495d6f6492f0daabda0d892df7c368 100644 (file)
@@ -36,6 +36,7 @@ public class DefaultSettingsTest {
 
     assertThat(props.value("sonar.search.javaOpts")).contains("-Xmx");
     assertThat(props.value("sonar.jdbc.username")).isEqualTo("sonar");
+    assertThat(props.valueAsInt("sonar.jdbc.maxActive")).isEqualTo(50);
   }
 
   @Test