wanglijie95 commented on a change in pull request #11499:
URL: https://github.com/apache/flink/pull/11499#discussion_r415334639



##########
File path: 
flink-connectors/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/JDBCOutputFormat.java
##########
@@ -87,8 +89,12 @@ public void open(int taskNumber, int numTasks) throws 
IOException {
        }
 
        @Override
-       public void writeRecord(Row row) {
+       public void writeRecord(Row row) throws IOException{
                try {
+                       if (!connection.isValid(connectionCheckTimeout)) {
+                               LOG.error("JDBC connection is closed,start to 
open a new connection");
+                               establishConnectionAndPreparedStatement();

Review comment:
       Maybe you should close the connection and statement firstly, and then 
reestablish.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to