davsclaus commented on code in PR #30044:
URL: https://github.com/apache/camel/pull/30044#discussion_r4580081499


##########
components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlProducer.java:
##########
@@ -276,18 +281,32 @@ protected Object processStreamList(
                 // and return the connection to the pool right away
                 exchange.getIn().setHeader(SqlConstants.SQL_UPDATE_COUNT, 
ps.getUpdateCount());
                 closeStatement(ps);
-                closeConnection(con);
+                DataSourceUtils.releaseConnection(con, ds);
             }
             return iterator;
         } catch (Exception e) {
             // in case of exception then close all this before rethrow
-            closeConnection(con);
-            closeStatement(ps);
             closeResultSet(rs);
+            closeStatement(ps);
+            DataSourceUtils.releaseConnection(con, ds);

Review Comment:
   `closeResultSet` and `closeStatement` here are the static imports of Spring 
`JdbcUtils`, which catch `Throwable`, so `releaseConnection` is always reached. 
No change needed.
   
   _Claude Code on behalf of davsclaus_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to