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 @@ -741,6 +741,15 @@ public ResultSet getResultSet() throws SQLException {
*/
public final void close() throws SQLException
{
if (connection.getQueryExecutor().isRingBufferThreadRunning() &&
(!connection.getAutoCommit() || getMaxRows() == 0))
{
// Wait for current ring buffer thread to finish, if any.
// Shouldn't call from synchronized method, which can cause dead-lock.
// We don't want to wait for ring buffer to fetch all rows if setMaxRows() is set,
// or if autoCommit is set to true
connection.getQueryExecutor().waitForRingBufferThreadToFinish(false, false, true, null, null);
}
if (RedshiftLogger.isEnable())
connection.getLogger().logFunction(true);

Expand Down