Skip to content

Commit 78226cc

Browse files
committed
Fixed bug introduced in the last commit of the ConnectionPool class
1 parent 68a31e2 commit 78226cc

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/javaxt/sql/ConnectionPool.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -693,19 +693,14 @@ private void performHealthCheck() {
693693
pconn.addConnectionEventListener(poolConnectionEventListener);
694694

695695
if (validateConnection(pconn)) {
696-
// Create and wrap connection for warm-up
697-
java.sql.Connection rawConn = pconn.getConnection();
696+
// Create unopened wrapper for warm-up
697+
// The wrapper will be opened when first acquired from the pool
698698
Connection connection = new Connection();
699-
connection.open(rawConn, database);
700-
701-
// Store the wrapper (but don't add to recycled yet - it's active)
702699
PooledConnectionWrapper w = new PooledConnectionWrapper(connection, pconn);
703700
connectionWrappers.put(pconn, w);
704701

705-
// Close the connection to recycle it
706-
// This will trigger connectionClosed event which calls recycleConnection()
707-
// recycleConnection() will add it to the recycled queue
708-
rawConn.close();
702+
// Add directly to recycled queue (skip the active state for warm-up)
703+
recycledConnections.offer(w);
709704

710705
currentRecycled++;
711706
total = currentActive + currentRecycled;

0 commit comments

Comments
 (0)