This is an automated email from the ASF dual-hosted git repository.

kirs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 61c6461  [BUG-6331][WorkerServer] fix preparedStatement auto close by 
try with resource (#6334)
61c6461 is described below

commit 61c64619949b2098f7efcd2cfcc701ef98564083
Author: caishunfeng <[email protected]>
AuthorDate: Fri Sep 24 18:39:04 2021 +0800

    [BUG-6331][WorkerServer] fix preparedStatement auto close by try with 
resource (#6334)
    
    Co-authored-by: caishunfeng <[email protected]>
---
 .../main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java
 
b/dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java
index 0712a7c..3846c35 100644
--- 
a/dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java
+++ 
b/dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java
@@ -372,7 +372,8 @@ public class SqlTask extends AbstractTaskExecutor {
         // is the timeout set
         boolean timeoutFlag = taskExecutionContext.getTaskTimeoutStrategy() == 
TaskTimeoutStrategy.FAILED
                 || taskExecutionContext.getTaskTimeoutStrategy() == 
TaskTimeoutStrategy.WARNFAILED;
-        try (PreparedStatement stmt = 
connection.prepareStatement(sqlBinds.getSql())) {
+        try {
+            PreparedStatement stmt = 
connection.prepareStatement(sqlBinds.getSql());
             if (timeoutFlag) {
                 stmt.setQueryTimeout(taskExecutionContext.getTaskTimeout());
             }

Reply via email to