Skip to content

Commit 1a39b84

Browse files
authored
Removed cleaning of unclosed result set (#71)
2 parents f7435de + 96ccf40 commit 1a39b84

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

jdbc/src/main/java/tech/ydb/jdbc/context/StreamQueryResult.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,17 +148,15 @@ private void closeResultSet(int index) throws SQLException {
148148
}
149149
}
150150

151-
private boolean isStreamStopped() {
151+
private void checkStream() {
152152
if (!resultClosed) {
153-
return false;
153+
return;
154154
}
155155

156156
if (!streamFuture.isDone() && streamCancelled.compareAndSet(false, true)) {
157157
LOGGER.log(Level.FINE, "Stream cancel");
158158
stopRunnable.run();
159159
}
160-
161-
return true;
162160
}
163161

164162
@Override
@@ -311,10 +309,7 @@ public void cleanQueue() {
311309
public void addResultSet(ResultSetReader rsr) {
312310
try {
313311
do {
314-
if (isStreamStopped()) {
315-
close();
316-
return;
317-
}
312+
checkStream();
318313
} while (!readers.offer(rsr, 100, TimeUnit.MILLISECONDS));
319314
} catch (InterruptedException ex) {
320315
if (streamFuture.completeExceptionally(ex)) {

0 commit comments

Comments
 (0)