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 0ffc6a523..262458622 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 @@ -112,6 +112,8 @@ public boolean init(List addresses, NebulaPoolConfig config) objConfig.setMaxTotal(config.getMaxConnSize()); objConfig.setTestOnBorrow(true); objConfig.setTestOnReturn(true); + objConfig.setTestOnCreate(true); + objConfig.setTestWhileIdle(true); objConfig.setTimeBetweenEvictionRunsMillis(config.getIntervalIdle() <= 0 ? BaseObjectPoolConfig.DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS : config.getIntervalIdle());