Skip to content

Commit c489774

Browse files
committed
1 parent bc58db5 commit c489774

File tree

4 files changed

+61
-0
lines changed

4 files changed

+61
-0
lines changed

Diff for: src/docs/asciidoc/appendices/connectionproperties/connectionproperties.adoc

+8
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ See <<ref-processinfo>> for more information.
7474
|Connection property (+ aliases)
7575
|Explanation
7676

77+
a|`asyncFetch`
78+
a|Jaybird specific property ([.since]_Jaybird 6_).
79+
Boolean property.
80+
Enables/disables async fetching for pure Java connections.
81+
Default is `true`.
82+
See <<ref-async-fetch>> for more information.
83+
7784
a|`encoding` +
7885
`lc_ctype`, `isc_dpb_lc_ctype`
7986
a|Character encoding for the connection using the Firebird character set name.
@@ -302,6 +309,7 @@ a|`createDatabaseIfNotExist`
302309
a|Jaybird specific property ([.since]_Jaybird 6_).
303310
Boolean property.
304311
Attempts to create a database if it does not exist.
312+
Default is `false`.
305313
See <<ref-create-database-if-not-exist>> for more information.
306314

307315
a|`reportSQLWarnings`

Diff for: src/docs/asciidoc/appendices/systemproperties/systemproperties.adoc

+13
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,20 @@ This property will have no effect if `org.firebirdsql.jdbc.defaultConnectionEnco
5252

5353
The property values are read for each connect, so the value can be changed at any time.
5454

55+
[#systemproperties-default-async-fetch]
56+
=== Default `asyncFetch` value
57+
58+
[.since]_Jaybird 6_
59+
60+
`org.firebirdsql.jdbc.defaultAsyncFetch`::
61+
Configures the default value for the `asyncFetch` connection property.
62+
See <<ref-async-fetch>> for more information.
63+
5564
[#systemproperties-default-enable-protocol]
5665
=== Default `enableProtocol` value
5766

67+
[.since]_Jaybird 6_
68+
5869
`org.firebirdsql.jdbc.defaultEnableProtocol`::
5970
Configures the default value for the `enableProtocol` connection property.
6071
See <<ref-enable-protocol>> for more information.
@@ -63,6 +74,8 @@ See <<ref-enable-protocol>> for more information.
6374

6475
=== Default `reportSQLWarnings` value
6576

77+
[.since]_Jaybird 6_
78+
6679
`org.firebirdsql.jdbc.defaultReportSQLWarnings`::
6780
Configures the default value for the `reportSQLWarnings` connection property.
6881
See <<ref-report-sql-warnings>> for more information.
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[#ref-async-fetch]
2+
=== Async fetch
3+
4+
[.since]_Jaybird 6_
5+
6+
For pure Java connections, non-holdable forward-only result sets perform asynchronous fetches by default.
7+
Asynchronous fetches are implemented for protocol implementation version 11 and higher (i.e. Firebird 2.1 or higher), but are formally only supported for protocol version 13 and higher (i.e. Firebird 3.0 or higher).
8+
9+
In normal usage of a result set, the first fetch will be a normal synchronous fetch.
10+
If certain conditions are met, subsequent fetches will be performed asynchronously.
11+
12+
The conditions for using asynchronous fetch are considered an implementation detail and may change in point releases.
13+
In Jaybird 6.0.0, the conditions to enable asynchronous fetching are:
14+
15+
. The result set has type `FORWARD_ONLY`.
16+
. The result set does not have a cursor name set.
17+
. Any synchronous fetch on the statement cursor retrieved at least 15 rows.
18+
Be aware that the server may return fewer rows than the configured fetch size (default is 400), depending on Firebird version, row size and other factors.
19+
20+
When the asynchronous fetch is triggered is also an implementation detail and may change in point releases.
21+
In Jaybird 6.0.0, the conditions to perform an asynchronous fetch are:
22+
23+
* Size of the row buffer is equal to the "`low-water mark`".
24+
+
25+
This "`low-water mark`" is calculated as ~33% of the maximum number of rows returned by previous fetches, with a minimum of 10 rows.
26+
+
27+
As a consequence of this condition, reducing the fetch size equal to or less than the "`low-water mark`" may cause asynchronous fetches to stop being triggered, as the buffer size may remain smaller than this "`low-water mark`" (this effect may be reduced if there is other activity on the connection after the asynchronous fetch was performed).
28+
In that case, a synchronous fetch is triggered when the buffer is empty.
29+
* Fetch size at time of async fetch is larger than 1.
30+
This may be the configured fetch size, or the fetch size derived taking into account the configured maximum row count.
31+
32+
Native connections do not support this type of asynchronous fetching, but `fbclient` itself provides a different form of internal asynchronous fetching for native connections.
33+
34+
Asynchronous fetching -- for pure Java -- can be disabled with the Boolean connection property `asyncFetch`, by setting it to `false`.
35+
The system property <<systemproperties-default-async-fetch,`org.firebirdsql.jdbc.defaultAsyncFetch`>> can be used to disable it globally;
36+
this system property is checked dynamically when the connection configuration is created.
37+
These properties are primarily intended for troubleshooting or workarounds if it turns out this feature has problems;
38+
they may be removed in a future Jaybird version once this feature has proven itself.

Diff for: src/docs/asciidoc/reference/reference.adoc

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
[[ref-connection]]
55
== Connection reference
66

7+
include::connection/asyncfetch.adoc[]
8+
79
include::connection/authenticationplugins.adoc[]
810

911
include::connection/wirecrypt.adoc[]

0 commit comments

Comments
 (0)