This commit is contained in:
Looly 2024-08-19 20:37:45 +08:00
parent db36ce0c3c
commit a403b2b30d

View File

@ -22,10 +22,10 @@ import org.dromara.hutool.core.pool.ObjectPool;
import org.dromara.hutool.core.pool.partition.PartitionObjectPool; import org.dromara.hutool.core.pool.partition.PartitionObjectPool;
import org.dromara.hutool.core.pool.partition.PartitionPoolConfig; import org.dromara.hutool.core.pool.partition.PartitionPoolConfig;
import org.dromara.hutool.core.text.StrUtil; import org.dromara.hutool.core.text.StrUtil;
import org.dromara.hutool.db.DbException;
import org.dromara.hutool.db.config.ConnectionConfig; import org.dromara.hutool.db.config.ConnectionConfig;
import org.dromara.hutool.db.driver.DriverUtil; import org.dromara.hutool.db.driver.DriverUtil;
import org.dromara.hutool.db.ds.simple.AbstractDataSource; import org.dromara.hutool.db.ds.simple.AbstractDataSource;
import org.dromara.hutool.log.LogUtil;
import org.dromara.hutool.setting.props.Props; import org.dromara.hutool.setting.props.Props;
import java.sql.Connection; import java.sql.Connection;
@ -125,7 +125,10 @@ public class PooledDataSource extends AbstractDataSource {
return null != connection return null != connection
&& connection.isValid(maxWait); && connection.isValid(maxWait);
} catch (final SQLException e) { } catch (final SQLException e) {
throw new DbException(e); // 验证对象时抛出异常会导致资源无法释放或回收此处忽略之
LogUtil.error(e);
//throw new DbException(e);
return false;
} }
} }