Skip to content

Commit 826f36a

Browse files
authored
Use the dataSource instead of getDataSource() to avoid connection leak
1 parent a441077 commit 826f36a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

flink-autoscaler-plugin-jdbc/src/test/java/org/apache/flink/autoscaler/jdbc/testutils/databases/postgres/PostgreSQLExtension.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public void afterAll(ExtensionContext extensionContext) {
7171
@Override
7272
public void afterEach(ExtensionContext extensionContext) throws Exception {
7373
try (var dataSource = getDataSource();
74-
var conn = getDataSource().getConnection();
74+
var conn = dataSource.getConnection();
7575
var st = conn.createStatement()) {
7676
for (var tableName : TABLES) {
7777
st.executeUpdate(String.format("DELETE from %s", tableName));

0 commit comments

Comments
 (0)