From 3fe8fc5280bcb0ced976a698fcae2dc977450ce6 Mon Sep 17 00:00:00 2001
From: Valery Kharseko <vharseko@3a-systems.ru>
Date: Mon, 28 Sep 2026 07:05:50 +0000
Subject: [PATCH] [#1074] Keep what says the connection is gone through the redaction of a connect failure (#1107)

---
 opendj-server-legacy/src/main/java/org/opends/server/backends/jdbc/JDBCStorage.java |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/jdbc/JDBCStorage.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/jdbc/JDBCStorage.java
index e38d3cf..d044534 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/jdbc/JDBCStorage.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/jdbc/JDBCStorage.java
@@ -4842,7 +4842,20 @@
 	 * failover took, and {@link #replayReason} fails an attempt that was worth replaying (issue #961).
 	 */
 	static boolean isConnectionFailure(Throwable failure) {
-		return firstLinkMatching(failure, WITH_THE_RELEASE, EVERY_LINK, JDBCStorage::saysTheConnectionIsGone)!=null;
+		return connectionFailureLink(failure)!=null;
+	}
+
+	/**
+	 * The link of a failure that says the connection is gone, found by the walk {@link #isConnectionFailure} answers
+	 * from, or null where none says so.
+	 * <p>
+	 * Package-private for the one other reader it has, the redaction of a connect failure in {@link
+	 * CachedConnection}: what that rebuild leaves in place of a chain past its budget has to say what this reads
+	 * off the links it cuts (#1074). It asks for the walk rather than for the question alone, so that a change to
+	 * the edges this walks changes what the tail carries along with what {@link #write} reads.
+	 */
+	static SQLException connectionFailureLink(Throwable failure) {
+		return firstLinkMatching(failure, WITH_THE_RELEASE, EVERY_LINK, JDBCStorage::saysTheConnectionIsGone);
 	}
 
 	/**
@@ -7071,8 +7084,9 @@
 		 * database that its dialect table does not recognize is raised at once instead: a mysql
 		 * account with a {@code MAX_USER_CONNECTIONS} of its own answers 1226 on SQLState 42000, and
 		 * a driver of no known dialect has no vendor code read at all (issue #1011). The type is no
-		 * rule either: a failure whose chain names the credentials of the backend is rebuilt as a
-		 * plain {@code SQLException} whatever the driver threw. Sorting them here would be that
+		 * rule either: a driver need not raise the standard JDBC type that names what happened, and a
+		 * failure whose chain names the credentials of the backend keeps only that standard type, not
+		 * the class of the driver (#1074). Sorting them here would be that
 		 * classification written out a second time, with the failure of a multi-hour import as the
 		 * cost of getting it wrong (issue #1013).
 		 * <p>

--
Gitblit v1.10.0