liugddx commented on code in PR #4123:
URL: 
https://github.com/apache/incubator-seatunnel/pull/4123#discussion_r1105596859


##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/sink/JdbcSinkWriter.java:
##########
@@ -69,6 +74,31 @@ private void tryOpen() throws IOException {
         }
     }
 
+    @Override
+    public void prepared() throws IOException {
+        if (CollectionUtils.isNotEmpty(jdbcSinkOptions.getPreSQL())) {
+            try {
+                tryOpen();
+                Connection conn = 
connectionProvider.getOrEstablishConnection();

Review Comment:
   The connection needs to be closed.



##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/sink/JdbcSinkWriter.java:
##########
@@ -113,6 +143,28 @@ public void close() throws IOException {
             throw new JdbcConnectorException(
                     CommonErrorCode.WRITER_OPERATION_FAILED, "unable to close 
JDBC sink write", e);
         }
+
+        if (CollectionUtils.isNotEmpty(jdbcSinkOptions.getPostSQL())) {
+            try {
+                Connection conn = 
connectionProvider.getOrEstablishConnection();

Review Comment:
   The connection needs to be closed.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to