Skip to content

Commit 0a3f63f

Browse files
committed
Fixed too low timeout for executeDataQuery
1 parent 9e2d5ce commit 0a3f63f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

jdbc/src/main/java/tech/ydb/jdbc/impl/BaseYdbStatement.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,15 @@ protected List<YdbResult> executeScanQuery(YdbQuery query, Params params) throws
198198
}
199199

200200
protected List<YdbResult> executeDataQuery(YdbQuery query, Params params) throws SQLException {
201+
ExecuteDataQuerySettings settings = new ExecuteDataQuerySettings();
202+
201203
int timeout = getQueryTimeout();
202-
ExecuteDataQuerySettings settings = new ExecuteDataQuerySettings()
203-
.setOperationTimeout(Duration.ofSeconds(timeout))
204-
.setTimeout(Duration.ofSeconds(timeout + 1));
204+
if (timeout > 0) {
205+
settings = settings
206+
.setOperationTimeout(Duration.ofSeconds(timeout))
207+
.setTimeout(Duration.ofSeconds(timeout + 1));
208+
}
209+
205210
if (!isPoolable()) {
206211
settings = settings.disableQueryCache();
207212
}

0 commit comments

Comments
 (0)