Skip to content

Commit edfffb7

Browse files
authored
codeine-253 disable connection pool on large deployment (#254)
1 parent 7ddb2ba commit edfffb7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/common/codeine/db/mysql/DbUtils.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,12 @@ private Connection getConnection(boolean useCompression) {
154154
String mysqlAddress = hostSelector.mysql().host() + ":" + hostSelector.mysql().port();
155155
String jdbcUrl = "jdbc:mysql://" + mysqlAddress + "/" + MysqlConstants.DB_NAME + "?useCompression=true";
156156
try {
157-
return getDBConnection(jdbcUrl, hostSelector.mysql());
157+
if (globalConfigurationJsonStore.get().large_deployment()) {
158+
return DriverManager
159+
.getConnection(jdbcUrl, hostSelector.mysql().user(), hostSelector.mysql().password());
160+
} else {
161+
return getDBConnection(jdbcUrl, hostSelector.mysql());
162+
}
158163
} catch (SQLException e) {
159164
throw new ConnectToDatabaseException(jdbcUrl, e);
160165
}

0 commit comments

Comments
 (0)