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


##########
components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java:
##########
@@ -194,21 +193,12 @@ private boolean 
doCreateAndExecuteSqlStatementWithHeaders(Exchange exchange, Str
 
     private boolean doCreateAndExecuteSqlStatement(Exchange exchange, String 
sql, Connection conn) throws Exception {
 
+        Statement stmt = null;
         ResultSet rs = null;
         boolean shouldCloseResources = true;
 
         try {
-            // We might need to leave it open to allow post-processing of the 
result set. This is why we

Review Comment:
   This is a bit wrong, in case you use JdbcOutputType.StreamList then we need 
to close it in the UoW, eg its when setResultSet returns false.
   
   But I think we can keep the closing in the finally block if setResultSet 
returns true. Then its closed eager in finally, and then again in UoW done, but 
its already closed and isClosed will return true.



-- 
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