This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch branch-1.2-lts in repository https://gitbox.apache.org/repos/asf/doris.git
commit c3244c5fa5f3739c0965aa5b24c7fab335335e3f Author: zhangstar333 <87313068+zhangstar...@users.noreply.github.com> AuthorDate: Sat Apr 22 22:07:34 2023 +0800 [refactor](jdbc) close datasource if no need to maintain the cache (#18724) after pr #18670 could use jvm parameters to init jdbc datasource, but when set JDBC_MIN_POOL=0, it can be immediately closed. There is no need to wait for the recycling timer. --- fe/java-udf/src/main/java/org/apache/doris/udf/JdbcExecutor.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fe/java-udf/src/main/java/org/apache/doris/udf/JdbcExecutor.java b/fe/java-udf/src/main/java/org/apache/doris/udf/JdbcExecutor.java index 5cff9a3534..9a6a2b9535 100644 --- a/fe/java-udf/src/main/java/org/apache/doris/udf/JdbcExecutor.java +++ b/fe/java-udf/src/main/java/org/apache/doris/udf/JdbcExecutor.java @@ -103,6 +103,12 @@ public class JdbcExecutor { if (conn != null) { conn.close(); } + if (minIdleSize == 0) { + // it can be immediately closed if there is no need to maintain the cache of datasource + druidDataSource.close(); + JdbcDataSource.getDataSource().getSourcesMap().clear(); + druidDataSource = null; + } resultSet = null; stmt = null; conn = null; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org