yunqingmoswu commented on code in PR #6921:
URL: https://github.com/apache/inlong/pull/6921#discussion_r1051841862


##########
inlong-sort/sort-connectors/jdbc/src/main/java/org/apache/inlong/sort/jdbc/internal/JdbcBatchingOutputFormat.java:
##########
@@ -330,6 +328,7 @@ public synchronized void flush() throws IOException {
                     LOG.error(
                             "JDBC connection is not valid, and reestablish 
connection failed.",
                             exception);
+                    clearBatch(exception);

Review Comment:
   If you choose to throw an exception, there is no need to report dirty data



##########
inlong-sort/sort-connectors/jdbc/src/main/java/org/apache/inlong/sort/jdbc/internal/JdbcBatchingOutputFormat.java:
##########
@@ -320,6 +317,7 @@ public synchronized void flush() throws IOException {
             } catch (SQLException e) {
                 LOG.error("JDBC executeBatch error, retry times = {}", i, e);
                 if (i >= executionOptions.getMaxRetries()) {
+                    clearBatch(e);

Review Comment:
   If you choose to throw an exception, there is no need to report dirty data



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