Skip to content

Commit

Permalink
[CONJ-884] connection.isValid error firing connectionErrorOccurred
Browse files Browse the repository at this point in the history
  • Loading branch information
rusher committed Jul 26, 2021
1 parent 877c4e3 commit 1056012
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/main/java/org/mariadb/jdbc/MariaDbConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,11 @@ public boolean isValid(final int timeout) throws SQLException {
try {
return protocol.isValid(timeout * 1000);
} catch (SQLException e) {
// eat
if (pooledConnection != null) {
MariaDbPooledConnection poolConnection = this.pooledConnection;
poolConnection.fireConnectionErrorOccurred(e);
poolConnection.close();
}
return false;
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/mariadb/jdbc/internal/util/pool/Pool.java
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,6 @@ private MariaDbPooledConnection getIdleConnection(long timeout, TimeUnit timeUni
// eat
}

totalConnection.decrementAndGet();

// validation failed
silentAbortConnection(item);
addConnectionRequest();
Expand Down

0 comments on commit 1056012

Please sign in to comment.