From b13bd5adb7bf36bd726afb80137d6d0786ae66f4 Mon Sep 17 00:00:00 2001 From: Radek Felcman Date: Mon, 27 Nov 2023 14:49:33 +0100 Subject: [PATCH] DatabasePlatform.wasFailureCommunicationBased() fix Signed-off-by: Radek Felcman --- .../persistence/internal/databaseaccess/DatabasePlatform.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/databaseaccess/DatabasePlatform.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/databaseaccess/DatabasePlatform.java index 31628168c50..787433c7a20 100644 --- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/databaseaccess/DatabasePlatform.java +++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/databaseaccess/DatabasePlatform.java @@ -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 @@ -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;