You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "zhfeng (via GitHub)" <gi...@apache.org> on 2023/04/10 09:10:47 UTC

[GitHub] [camel] zhfeng commented on a diff in pull request #9827: CAMEL-19256: camel-jdbc - close stmt in the finnal block

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


##########
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:
   if `setResultSet` resturns `false`, it has added `exchange.getExchangeExtension().addOnCompletion(new ResultSetIteratorCompletion(iterator))`. So I think we don't need to close it in the UoW here. 



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org