Skip to content

Commit 8ea86b2

Browse files
committed
Improve/fix documentation and comments about fetch scroll
1 parent 49ea334 commit 8ea86b2

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/main/org/firebirdsql/gds/ng/FbStatement.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: Copyright 2013-2024 Mark Rotteveel
1+
// SPDX-FileCopyrightText: Copyright 2013-2025 Mark Rotteveel
22
// SPDX-FileCopyrightText: Copyright 2019 Vasiliy Yashkov
33
// SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause
44
package org.firebirdsql.gds.ng;
@@ -170,11 +170,11 @@ public interface FbStatement extends ExceptionListenable, AutoCloseable {
170170
* </p>
171171
* <p>
172172
* The caller is responsible for tracking and correcting for server-side positional state, taking into account any
173-
* rows already fetched. For example, if 100 rows have been fetched with {@code NEXT} or {@code PRIOR}, and 80
174-
* rows are still in the local buffer, the server-side position is actually 80 rows ahead (or behind). The next
175-
* fetch with {@code RELATIVE} will need to correct this in {@code position}, and a {@code PRIOR} after
176-
* a {@code NEXT} or a {@code NEXT} after a {@code PRIOR} will need to reposition with {@code RELATIVE} or
177-
* {@code ABSOLUTE}, or know how many rows to ignore from the fetched batch.
173+
* rows already fetched. For example, if 100 rows have been fetched with {@code NEXT}, and 80 rows are still in
174+
* the local buffer, the server-side position is actually 80 rows ahead. The next fetch with {@code RELATIVE} will
175+
* need to correct for this in {@code position}, and a {@code PRIOR} after a {@code NEXT} or a {@code NEXT} after
176+
* a {@code PRIOR} will need to reposition with {@code RELATIVE} or {@code ABSOLUTE}, or know how many rows to
177+
* ignore from the fetched batch.
178178
* </p>
179179
* <p>
180180
* If an asynchronous fetch is pending, the behaviour depends on the value of {@code fetchType}:

src/main/org/firebirdsql/gds/ng/wire/version10/V10Statement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ protected void sendFetch(int fetchSize) throws SQLException, IOException {
480480
xdrOut.writeInt(getHandle()); // p_sqldata_statement
481481
xdrOut.writeBuffer(hasFetched() ? null : calculateBlr(getRowDescriptor())); // p_sqldata_blr
482482
xdrOut.writeInt(0); // p_sqldata_message_number
483-
xdrOut.writeInt(fetchSize); // p_sqldata_messages
483+
xdrOut.writeInt(fetchSize); // p_sqldata_messages - fetch size
484484
}
485485

486486
/**

src/main/org/firebirdsql/gds/ng/wire/version18/V18Statement.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: Copyright 2021-2024 Mark Rotteveel
1+
// SPDX-FileCopyrightText: Copyright 2021-2025 Mark Rotteveel
22
// SPDX-License-Identifier: LGPL-2.1-or-later
33
package org.firebirdsql.gds.ng.wire.version18;
44

@@ -75,11 +75,11 @@ protected void fetchScrollImpl(FetchType fetchType, int fetchSize, int position)
7575

7676
protected void sendFetchScroll(FetchType fetchType, int fetchSize, int position) throws SQLException, IOException {
7777
final XdrOutputStream xdrOut = getXdrOut();
78-
xdrOut.writeInt(WireProtocolConstants.op_fetch_scroll);
79-
xdrOut.writeInt(getHandle());
80-
xdrOut.writeBuffer(hasFetched() ? null : calculateBlr(getRowDescriptor()));
81-
xdrOut.writeInt(0); // out_message_number = out_message_type
82-
xdrOut.writeInt(fetchSize); // fetch size
78+
xdrOut.writeInt(WireProtocolConstants.op_fetch_scroll); // p_operation
79+
xdrOut.writeInt(getHandle()); // p_sqldata_statement
80+
xdrOut.writeBuffer(hasFetched() ? null : calculateBlr(getRowDescriptor())); // p_sqldata_blr
81+
xdrOut.writeInt(0); // p_sqldata_message_number
82+
xdrOut.writeInt(fetchSize); // p_sqldata_messages - fetch size
8383
xdrOut.writeInt(fetchType.getFbFetchType()); // p_sqldata_fetch_op
8484
xdrOut.writeInt(position); // p_sqldata_fetch_pos
8585
}

0 commit comments

Comments
 (0)