Skip to content

Commit

Permalink
Fixes #1308 treat a SQLTimeoutException as an evictable offense
Browse files Browse the repository at this point in the history
  • Loading branch information
brettwooldridge committed Jan 28, 2019
1 parent 80d382d commit cda2605
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/com/zaxxer/hikari/pool/ProxyConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ final SQLException checkException(SQLException sqle)
SQLException nse = sqle;
for (int depth = 0; delegate != ClosedConnection.CLOSED_CONNECTION && nse != null && depth < 10; depth++) {
final String sqlState = nse.getSQLState();
if (sqlState != null && sqlState.startsWith("08") || ERROR_STATES.contains(sqlState) || ERROR_CODES.contains(nse.getErrorCode())) {
if (sqlState != null && sqlState.startsWith("08")
|| nse instanceof SQLTimeoutException
|| ERROR_STATES.contains(sqlState)
|| ERROR_CODES.contains(nse.getErrorCode())) {

// broken connection
LOGGER.warn("{} - Connection {} marked as broken because of SQLSTATE({}), ErrorCode({})",
poolEntry.getPoolName(), delegate, sqlState, nse.getErrorCode(), nse);
Expand Down

0 comments on commit cda2605

Please sign in to comment.