From 8931e25049c1888885b1bfee96e6b865b60ee4d2 Mon Sep 17 00:00:00 2001 From: rezra3 Date: Mon, 6 May 2019 16:11:12 +0300 Subject: [PATCH] codeine-253 disable connection pool on large deployment --- src/common/codeine/db/mysql/DbUtils.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/codeine/db/mysql/DbUtils.java b/src/common/codeine/db/mysql/DbUtils.java index bcbe290b..9188f08a 100755 --- a/src/common/codeine/db/mysql/DbUtils.java +++ b/src/common/codeine/db/mysql/DbUtils.java @@ -154,7 +154,12 @@ private Connection getConnection(boolean useCompression) { String mysqlAddress = hostSelector.mysql().host() + ":" + hostSelector.mysql().port(); String jdbcUrl = "jdbc:mysql://" + mysqlAddress + "/" + MysqlConstants.DB_NAME + "?useCompression=true"; try { - return getDBConnection(jdbcUrl, hostSelector.mysql()); + if (globalConfigurationJsonStore.get().large_deployment()) { + return DriverManager + .getConnection(jdbcUrl, hostSelector.mysql().user(), hostSelector.mysql().password()); + } else { + return getDBConnection(jdbcUrl, hostSelector.mysql()); + } } catch (SQLException e) { throw new ConnectToDatabaseException(jdbcUrl, e); }