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

roryqi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/main by this push:
     new aac8aa53ca [#6874] improvement(core): Set `testOnBorrow` to true to 
avoid possible connection timeout problem (#6878)
aac8aa53ca is described below

commit aac8aa53ca2ef17a8443c241dbc10fc18a0d1e1d
Author: Mini Yu <[email protected]>
AuthorDate: Mon Apr 14 10:50:25 2025 +0800

    [#6874] improvement(core): Set `testOnBorrow` to true to avoid possible 
connection timeout problem (#6878)
    
    ### What changes were proposed in this pull request?
    
    Set t`estOnBorrow` and `setTestWhileIdle` of JDBC connection pool from
    `false` to `true`.
    
    ### Why are the changes needed?
    
    If the configuration is false, there may be connection problems.
    
    Fix: #6874
    
    ### Does this PR introduce _any_ user-facing change?
    
    N/A.
    
    ### How was this patch tested?
    
    The existing tests.
---
 .../gravitino/storage/relational/session/SqlSessionFactoryHelper.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/core/src/main/java/org/apache/gravitino/storage/relational/session/SqlSessionFactoryHelper.java
 
b/core/src/main/java/org/apache/gravitino/storage/relational/session/SqlSessionFactoryHelper.java
index 6cfb428b92..fb870bc7f7 100644
--- 
a/core/src/main/java/org/apache/gravitino/storage/relational/session/SqlSessionFactoryHelper.java
+++ 
b/core/src/main/java/org/apache/gravitino/storage/relational/session/SqlSessionFactoryHelper.java
@@ -98,8 +98,8 @@ public class SqlSessionFactoryHelper {
     dataSource.setRemoveAbandonedOnBorrow(true);
     dataSource.setRemoveAbandonedTimeout(60);
     dataSource.setTimeBetweenEvictionRunsMillis(Duration.ofMillis(10 * 60 * 
1000L).toMillis());
-    dataSource.setTestOnBorrow(BaseObjectPoolConfig.DEFAULT_TEST_ON_BORROW);
-    dataSource.setTestWhileIdle(BaseObjectPoolConfig.DEFAULT_TEST_WHILE_IDLE);
+    dataSource.setTestOnBorrow(true);
+    dataSource.setTestWhileIdle(true);
     dataSource.setMinEvictableIdleTimeMillis(1000);
     
dataSource.setNumTestsPerEvictionRun(BaseObjectPoolConfig.DEFAULT_NUM_TESTS_PER_EVICTION_RUN);
     dataSource.setTestOnReturn(BaseObjectPoolConfig.DEFAULT_TEST_ON_RETURN);

Reply via email to