From a5bb36dee4d99d543f2fc87e13e43adffae550e1 Mon Sep 17 00:00:00 2001 From: hantmac Date: Wed, 25 Sep 2024 23:41:41 +0800 Subject: [PATCH] fix: rout hint policy in transaction --- .../src/main/java/com/databend/jdbc/DatabendConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/databend-jdbc/src/main/java/com/databend/jdbc/DatabendConnection.java b/databend-jdbc/src/main/java/com/databend/jdbc/DatabendConnection.java index 922d4dbd..c2a27c9a 100644 --- a/databend-jdbc/src/main/java/com/databend/jdbc/DatabendConnection.java +++ b/databend-jdbc/src/main/java/com/databend/jdbc/DatabendConnection.java @@ -704,7 +704,7 @@ DatabendClient startQueryWithFailover(String sql, StageAttachment attach) throws // 3. if there is not active transaction, it will use load balancing policy to choose a host to execute query String query_id = UUID.randomUUID().toString(); String candidateHost = this.driverUri.getUri(query_id).toString(); - if (!inActiveTransaction()) { + if (inActiveTransaction()) { this.routeHint = uriRouteHint(candidateHost); } // checkout the host to use from route hint