Sai Sharath Dandi created FLINK-34635:
-----------------------------------------

             Summary: Clear successful records from the batch in JDBC connector
                 Key: FLINK-34635
                 URL: https://issues.apache.org/jira/browse/FLINK-34635
             Project: Flink
          Issue Type: Improvement
          Components: Connectors / JDBC
            Reporter: Sai Sharath Dandi


Currently, when batch execution fails in the JDBC connector, the whole batch is 
retried in the JDBC connector which is unnecessary. We should clear the records 
that were successful in the 
[SimpleBatchStatementExecutor|https://github.com/apache/flink-connector-jdbc/blob/main/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/internal/executor/SimpleBatchStatementExecutor.java]


{code:java}
 @Override
    public void executeBatch() throws SQLException {
        if (!batch.isEmpty()) {
            for (T r : batch) {
                parameterSetter.accept(st, r);
                st.addBatch();
            }
            st.executeBatch();
--> catch the exception and clear successful records from the batch here
            batch.clear();
        }
    }{code}
 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to