Browse Source

Merge pull request #6623 in CORE/base-third from persist/11.0 to persist/jsy11

* commit 'cad875b91a014321efd92d02e40da2b87a8b240e':
  REPORT-76958 Druid获取连接的重试次数配置有bug
  REPORT-77015 Druid连接失败时抛出的报错不方便直接查看原因,10.0是可以的
persist/jsy11
superman 2 years ago
parent
commit
3f26a0b125
  1. 6
      fine-druid/src/main/java/com/fr/third/alibaba/druid/pool/DruidDataSource.java

6
fine-druid/src/main/java/com/fr/third/alibaba/druid/pool/DruidDataSource.java

@ -1482,7 +1482,7 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
try {
poolableConnection = getConnectionInternal(maxWaitMillis);
} catch (GetConnectionTimeoutException ex) {
if (notFullTimeoutRetryCnt <= this.notFullTimeoutRetryCount && !isFull()) {
if (notFullTimeoutRetryCnt < this.notFullTimeoutRetryCount && !isFull()) {
notFullTimeoutRetryCnt++;
if (LOG.isWarnEnabled()) {
LOG.warn("get connection timeout retry : " + notFullTimeoutRetryCnt);
@ -1830,7 +1830,11 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
String errorMessage = buf.toString();
if (createError != null) {
if (createError instanceof SQLException) {
throw (SQLException)createError;
} else {
throw new GetConnectionTimeoutException(errorMessage, createError);
}
} else {
throw new GetConnectionTimeoutException(errorMessage);
}

Loading…
Cancel
Save