This is an automated email from the ASF dual-hosted git repository.

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 2523fa0  fix twice connections (#9082)
2523fa0 is described below

commit 2523fa0680d6324da7921241b614d52c3a9ca25b
Author: Zhang Yonglun <[email protected]>
AuthorDate: Mon Jan 18 23:06:59 2021 +0800

    fix twice connections (#9082)
    
    * fix double connections
---
 .../jdbc/datasource/decorator/HikariJDBCParameterDecorator.java       | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/datasource/decorator/HikariJDBCParameterDecorator.java
 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/datasource/decorator/HikariJDBCParameterDecorator.java
index d76835a..4bf0592 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/datasource/decorator/HikariJDBCParameterDecorator.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/datasource/decorator/HikariJDBCParameterDecorator.java
@@ -39,7 +39,9 @@ public final class HikariJDBCParameterDecorator implements 
JDBCParameterDecorato
         dataSource.getDataSourceProperties().setProperty("maintainTimeStats", 
Boolean.FALSE.toString());
         
dataSource.getDataSourceProperties().setProperty("netTimeoutForStreamingResults",
 "0");
         dataSource.getDataSourceProperties().setProperty("tinyInt1isBit", 
Boolean.FALSE.toString());
-        return new HikariDataSource(dataSource);
+        HikariDataSource result = new HikariDataSource(dataSource);
+        dataSource.close();
+        return result;
     }
     
     @Override

Reply via email to