You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/09/30 08:23:49 UTC

[GitHub] [inlong] healchow commented on a diff in pull request #6077: [INLONG-6076][Audit] Bugs in the ClickHouseService.processOutput()

healchow commented on code in PR #6077:
URL: https://github.com/apache/inlong/pull/6077#discussion_r984340515


##########
inlong-audit/audit-store/src/main/java/org/apache/inlong/audit/service/ClickHouseService.java:
##########
@@ -99,10 +99,13 @@ private void processOutput() {
             return;
         }
         // output
-        try (PreparedStatement pstat = this.conn.prepareStatement(INSERT_SQL)) {

Review Comment:
   Suggested using the `try-with-resource`, because the `PreparedStatement` implements the `AutoCloseable` interface, it will be closed automatically, we don't need to write additional `finally` block to close it.



##########
inlong-audit/audit-store/src/main/java/org/apache/inlong/audit/service/ClickHouseService.java:
##########
@@ -99,10 +99,13 @@ private void processOutput() {
             return;
         }
         // output
-        try (PreparedStatement pstat = this.conn.prepareStatement(INSERT_SQL)) {

Review Comment:
   Suggested using the `try-with-resource`, because the `PreparedStatement` implements the `AutoCloseable` interface, it will be closed automatically, we don't need to write an additional `finally` block to close it.



-- 
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@inlong.apache.org

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