未验证 提交 61c64619 编写于 作者: C caishunfeng 提交者: GitHub

[BUG-6331][WorkerServer] fix preparedStatement auto close by try with resource (#6334)

Co-authored-by: Ncaishunfeng <534328519@qq.com>
上级 89cc0459
......@@ -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());
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册