wanglijie95 commented on a change in pull request #12427:
URL: https://github.com/apache/flink/pull/12427#discussion_r434644645
##########
File path:
flink-connectors/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/internal/JdbcBatchingOutputFormat.java
##########
@@ -175,6 +176,15 @@ public synchronized void flush() throws IOException {
if (i >= executionOptions.getMaxRetries()) {
throw new IOException(e);
}
+ try {
+ if
(!connection.isValid(JdbcLookupFunction.CONNECTION_CHECK_TIMEOUT)) {
+ connection =
connectionProvider.reestablishConnection();
+
jdbcStatementExecutor.reopen(connection);
+ }
+ } catch (Exception excpetion) {
+ LOG.error("JDBC connection is not
valid, and reestablish connection failed.", excpetion);
+ throw new RuntimeException("Reestablish
JDBC connection failed", excpetion);
Review comment:
OK,I will change 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.
For queries about this service, please contact Infrastructure at:
[email protected]