Skip to content

Commit

Permalink
DatabasePlatform.wasFailureCommunicationBased() fix (eclipse-ee4j#2009)
Browse files Browse the repository at this point in the history
Signed-off-by: Radek Felcman <[email protected]>
  • Loading branch information
rfelcman authored Nov 29, 2023
1 parent 362e4fb commit a3e496e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2022 IBM Corporation. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -3231,7 +3231,7 @@ public boolean wasFailureCommunicationBased(SQLException exception, Connection c
// By default use the JDBC isValid API unless a ping SQL has been set.
// The ping SQL is set by most platforms, but user could set to null to used optimized JDBC check if desired.
try {
return connection.isValid(IS_VALID_TIMEOUT);
return !connection.isValid(IS_VALID_TIMEOUT);
} catch (Throwable failed) {
// Catch throwable as old JDBC drivers may not support isValid.
return false;
Expand Down

0 comments on commit a3e496e

Please sign in to comment.