File tree Expand file tree Collapse file tree
ebean-datasource/src/main/java/io/ebean/datasource/pool Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -601,6 +601,10 @@ void returnConnectionForceClose(PooledConnection pooledConnection) {
601601 returnTheConnection (pooledConnection , true );
602602 }
603603
604+ void removeClosedConnection (PooledConnection pooledConnection ) {
605+ queue .returnPooledConnection (pooledConnection , true );
606+ }
607+
604608 /**
605609 * Return connection. If forceClose is true then this is a bad connection that
606610 * must be removed and closed fully.
Original file line number Diff line number Diff line change @@ -394,6 +394,10 @@ public void close() throws SQLException {
394394 }
395395
396396 try {
397+ if (connection .isClosed ()) {
398+ pool .removeClosedConnection (this );
399+ return ;
400+ }
397401 // reset the autoCommit back if client code changed it
398402 if (resetAutoCommit ) {
399403 connection .setAutoCommit (pool .isAutoCommit ());
You can’t perform that action at this time.
0 commit comments