|
|
|
@ -27,6 +27,7 @@ import java.util.HashSet;
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
import java.util.concurrent.Executor;
|
|
|
|
|
|
|
|
|
|
import static com.zaxxer.hikari.SQLExceptionOverride.Override.CONTINUE_EVICT;
|
|
|
|
|
import static com.zaxxer.hikari.SQLExceptionOverride.Override.DO_NOT_EVICT;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -155,14 +156,13 @@ public abstract class ProxyConnection implements Connection
|
|
|
|
|
final var exceptionOverride = poolEntry.getPoolBase().exceptionOverride;
|
|
|
|
|
for (int depth = 0; delegate != ClosedConnection.CLOSED_CONNECTION && nse != null && depth < 10; depth++) {
|
|
|
|
|
final var sqlState = nse.getSQLState();
|
|
|
|
|
if (sqlState != null && sqlState.startsWith("08")
|
|
|
|
|
|| nse instanceof SQLTimeoutException
|
|
|
|
|
|| ERROR_STATES.contains(sqlState)
|
|
|
|
|
|| ERROR_CODES.contains(nse.getErrorCode())) {
|
|
|
|
|
|
|
|
|
|
if (exceptionOverride != null && exceptionOverride.adjudicate(nse) == DO_NOT_EVICT) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
else if (sqlState != null && sqlState.startsWith("08")
|
|
|
|
|
|| nse instanceof SQLTimeoutException
|
|
|
|
|
|| ERROR_STATES.contains(sqlState)
|
|
|
|
|
|| ERROR_CODES.contains(nse.getErrorCode())) {
|
|
|
|
|
|
|
|
|
|
// broken connection
|
|
|
|
|
evict = true;
|
|
|
|
@ -544,19 +544,16 @@ public abstract class ProxyConnection implements Connection
|
|
|
|
|
{
|
|
|
|
|
InvocationHandler handler = (proxy, method, args) -> {
|
|
|
|
|
final String methodName = method.getName();
|
|
|
|
|
if ("isClosed".equals(methodName)) {
|
|
|
|
|
switch (methodName) {
|
|
|
|
|
case "isClosed":
|
|
|
|
|
return Boolean.TRUE;
|
|
|
|
|
}
|
|
|
|
|
else if ("isValid".equals(methodName)) {
|
|
|
|
|
case "isValid":
|
|
|
|
|
return Boolean.FALSE;
|
|
|
|
|
}
|
|
|
|
|
if ("abort".equals(methodName)) {
|
|
|
|
|
case "abort":
|
|
|
|
|
return Void.TYPE;
|
|
|
|
|
}
|
|
|
|
|
if ("close".equals(methodName)) {
|
|
|
|
|
case "close":
|
|
|
|
|
return Void.TYPE;
|
|
|
|
|
}
|
|
|
|
|
else if ("toString".equals(methodName)) {
|
|
|
|
|
case "toString":
|
|
|
|
|
return ClosedConnection.class.getCanonicalName();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|