[
https://issues.apache.org/jira/browse/FLINK-34635?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sai Sharath Dandi updated FLINK-34635:
--------------------------------------
Affects Version/s: 1.18.1
> 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
> Affects Versions: 1.18.1
> Reporter: Sai Sharath Dandi
> Priority: Minor
>
> 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)