diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/NebulaPool.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/NebulaPool.java index ec4d419f1..d7fb0daed 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/NebulaPool.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/NebulaPool.java @@ -94,6 +94,10 @@ public boolean init(List addresses, NebulaPoolConfig config) objConfig.setMinIdle(config.getMinConnSize()); objConfig.setMaxIdle(config.getMaxConnSize()); objConfig.setMaxTotal(config.getMaxConnSize()); + objConfig.setTestOnBorrow(true); + objConfig.setTestOnReturn(true); + objConfig.setTestWhileIdle(true); + objConfig.setTestOnCreate(true); objConfig.setTimeBetweenEvictionRunsMillis(config.getIntervalIdle() <= 0 ? BaseObjectPoolConfig.DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS : config.getIntervalIdle());