Skip to content

Commit

Permalink
RingBuffer to respect setMaxRows on statement
Browse files Browse the repository at this point in the history
  • Loading branch information
bhvkshah committed Apr 13, 2023
1 parent 037beb4 commit 96bed2e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -729,10 +729,13 @@ public ResultSet getResultSet() throws SQLException {
* {@inheritDoc}
*/
public final void close() throws SQLException {
if(connection.getQueryExecutor().isRingBufferThreadRunning())
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);
}

Expand Down

0 comments on commit 96bed2e

Please sign in to comment.