Skip to content

Commit 788e34c

Browse files
authored
Merge pull request #120 from datafuselabs/fix/close-presign-stmt
fix: close presign stmt finally
2 parents 503a97a + 7029a0f commit 788e34c

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

databend-jdbc/src/main/java/com/databend/jdbc/PresignContext.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,9 @@ public static PresignContext getPresignContext(DatabendConnection connection, Pr
6060
throw new SQLException("Failed to get presign url");
6161
}
6262
} catch (Throwable e) {
63-
try {
64-
statement.close();
65-
} catch (Throwable closeException) {
66-
if (closeException != e) {
67-
e.addSuppressed(closeException);
68-
}
69-
}
70-
throw e;
63+
throw new SQLException("Failed to do presign");
64+
} finally {
65+
statement.close();
7166
}
7267
}
7368

0 commit comments

Comments
 (0)