Github user jrthe42 commented on a diff in the pull request:
https://github.com/apache/flink/pull/6301#discussion_r201702302
--- Diff:
flink-connectors/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/JDBCOutputFormat.java
---
@@ -111,110 +134,117 @@ public void writeRecord(Row row) throws IOException
{
if (typesArray != null && typesArray.length > 0 &&
typesArray.length != row.getArity()) {
LOG.warn("Column SQL types array doesn't match arity of
passed Row! Check the passed array...");
}
- try {
+ synchronized (this) {
--- End diff --
we need synchronization because two ```flush()``` may be called by two
separated thread. As it is explained in **the purpose of the change**.
---