Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@

package io.trino.tempto.query;

import com.google.inject.Inject;
import io.trino.tempto.context.TestContext;
import org.slf4j.Logger;

import com.google.inject.Inject;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Arrays;

import static io.trino.tempto.query.QueryResult.forSingleIntegerValue;
import static io.trino.tempto.query.QueryResult.toSqlIndex;
Expand Down Expand Up @@ -87,8 +85,13 @@ public QueryResult executeQuery(String sql, QueryParam... params)
@Override
public Connection getConnection()
{
if (connection == null) {
openConnection();
try {
if (connection == null || connection.isClosed()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so you can use connection after it closure? and so do you expect that one will close it again?

openConnection();
}
}
catch (SQLException e) {
throw new RuntimeException(e);
}
return connection;
}
Expand Down
Loading