|
|
@ -2164,10 +2164,13 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat |
|
|
|
try { |
|
|
|
try { |
|
|
|
connection = createPhysicalConnection(); |
|
|
|
connection = createPhysicalConnection(); |
|
|
|
setFailContinuous(false); |
|
|
|
setFailContinuous(false); |
|
|
|
} catch (SQLException e) { |
|
|
|
} catch (SQLException | RuntimeException e) { |
|
|
|
LOG.error("create connection error, url: " + jdbcUrl + ", errorCode " + e.getErrorCode() |
|
|
|
if (e instanceof SQLException) { |
|
|
|
+ ", state " + e.getSQLState(), e); |
|
|
|
LOG.error("create connection error, url: " + jdbcUrl + ", errorCode " + ((SQLException)e).getErrorCode() |
|
|
|
|
|
|
|
+ ", state " + ((SQLException)e).getSQLState(), e); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
LOG.error("create connection error", e); |
|
|
|
|
|
|
|
} |
|
|
|
errorCount++; |
|
|
|
errorCount++; |
|
|
|
if (errorCount > connectionErrorRetryAttempts && timeBetweenConnectErrorMillis > 0) { |
|
|
|
if (errorCount > connectionErrorRetryAttempts && timeBetweenConnectErrorMillis > 0) { |
|
|
|
// fail over retry attempts
|
|
|
|
// fail over retry attempts
|
|
|
@ -2193,10 +2196,6 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat |
|
|
|
DruidDataSource.this.doSomethingBeforeCreationThreadBreak(); |
|
|
|
DruidDataSource.this.doSomethingBeforeCreationThreadBreak(); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (RuntimeException e) { |
|
|
|
|
|
|
|
LOG.error("create connection error", e); |
|
|
|
|
|
|
|
setFailContinuous(true); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} catch (Error e) { |
|
|
|
} catch (Error e) { |
|
|
|
LOG.error("create connection error", e); |
|
|
|
LOG.error("create connection error", e); |
|
|
|
setFailContinuous(true); |
|
|
|
setFailContinuous(true); |
|
|
|