You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/09/27 06:26:37 UTC

[GitHub] [incubator-seatunnel] CalvinKirs commented on a diff in pull request #2904: [hotfix][connector][jdbc] fix JDBC split exception

CalvinKirs commented on code in PR #2904:
URL: https://github.com/apache/incubator-seatunnel/pull/2904#discussion_r980801070


##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/JdbcSourceReader.java:
##########
@@ -58,20 +58,22 @@ public void close() throws IOException {
     @Override
     @SuppressWarnings("magicnumber")
     public void pollNext(Collector<SeaTunnelRow> output) throws Exception {
-        JdbcSourceSplit split = splits.poll();
-        if (null != split) {
-            inputFormat.open(split);
-            while (!inputFormat.reachedEnd()) {
-                SeaTunnelRow seaTunnelRow = inputFormat.nextRecord();
-                output.collect(seaTunnelRow);
+        synchronized (output.getCheckpointLock()) {

Review Comment:
   Is there any other better way than `synchronized`?



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org