github-code-scanning[bot] commented on code in PR #757:
URL: 
https://github.com/apache/incubator-baremaps/pull/757#discussion_r1329175795


##########
baremaps-core/src/main/java/org/apache/baremaps/workflow/tasks/ExecuteSql.java:
##########
@@ -34,9 +38,9 @@
     queries.forEach(
         query -> {
           var dataSource = context.getDataSource(database);
-          try (var connection = dataSource.getConnection();
-              var statement = connection.createStatement()) {
-            statement.execute(query);
+          try (var connection = dataSource.getConnection()) {
+            logger.info("Execute SQL query: {}", query);
+            connection.createStatement().execute(query);

Review Comment:
   ## Potential database resource leak
   
   This Statement is not always closed on method exit.
   
   [Show more 
details](https://github.com/apache/incubator-baremaps/security/code-scanning/559)



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