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";
#----- 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
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;
}
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