From 0fca7cd47bff0e20e14f31d68a66cd61e2ad2c07 Mon Sep 17 00:00:00 2001 From: redkale Date: Tue, 18 Apr 2023 08:51:07 +0800 Subject: [PATCH] =?UTF-8?q?DataJdbcSource=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/redkale/source/DataJdbcSource.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/redkale/source/DataJdbcSource.java b/src/main/java/org/redkale/source/DataJdbcSource.java index 4d46a4e14..b8064cebb 100644 --- a/src/main/java/org/redkale/source/DataJdbcSource.java +++ b/src/main/java/org/redkale/source/DataJdbcSource.java @@ -2792,9 +2792,15 @@ public class DataJdbcSource extends AbstractDataSqlSource { this.queue = newQueue; this.maxConns = newMaxconns; this.canNewSemaphore = new Semaphore(this.maxConns); - Connection conn; - while ((conn = oldQueue.poll()) != null) { - offerConnection(conn, oldSemaphore); + Connection c; + while ((c = oldQueue.poll()) != null) { + try { + if (c.getClientInfo() != null) { + c.getClientInfo().put("version", "-1"); + } + } catch (SQLException e) { + } + offerConnection(c, oldSemaphore); } } } @@ -2830,6 +2836,12 @@ public class DataJdbcSource extends AbstractDataSqlSource { this.canNewSemaphore = new Semaphore(this.maxConns); Connection c; while ((c = oldQueue.poll()) != null) { + try { + if (c.getClientInfo() != null) { + c.getClientInfo().put("version", "-1"); + } + } catch (SQLException e) { + } offerConnection(c, oldSemaphore); } }