-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document FirebirdSQL/jaybird#831 and FirebirdSQL/jaybird#755
- Loading branch information
1 parent
bc58db5
commit c489774
Showing
4 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[#ref-async-fetch] | ||
=== Async fetch | ||
|
||
[.since]_Jaybird 6_ | ||
|
||
For pure Java connections, non-holdable forward-only result sets perform asynchronous fetches by default. | ||
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). | ||
|
||
In normal usage of a result set, the first fetch will be a normal synchronous fetch. | ||
If certain conditions are met, subsequent fetches will be performed asynchronously. | ||
|
||
The conditions for using asynchronous fetch are considered an implementation detail and may change in point releases. | ||
In Jaybird 6.0.0, the conditions to enable asynchronous fetching are: | ||
|
||
. The result set has type `FORWARD_ONLY`. | ||
. The result set does not have a cursor name set. | ||
. Any synchronous fetch on the statement cursor retrieved at least 15 rows. | ||
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. | ||
|
||
When the asynchronous fetch is triggered is also an implementation detail and may change in point releases. | ||
In Jaybird 6.0.0, the conditions to perform an asynchronous fetch are: | ||
|
||
* Size of the row buffer is equal to the "`low-water mark`". | ||
+ | ||
This "`low-water mark`" is calculated as ~33% of the maximum number of rows returned by previous fetches, with a minimum of 10 rows. | ||
+ | ||
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). | ||
In that case, a synchronous fetch is triggered when the buffer is empty. | ||
* Fetch size at time of async fetch is larger than 1. | ||
This may be the configured fetch size, or the fetch size derived taking into account the configured maximum row count. | ||
Native connections do not support this type of asynchronous fetching, but `fbclient` itself provides a different form of internal asynchronous fetching for native connections. | ||
|
||
Asynchronous fetching -- for pure Java -- can be disabled with the Boolean connection property `asyncFetch`, by setting it to `false`. | ||
The system property <<systemproperties-default-async-fetch,`org.firebirdsql.jdbc.defaultAsyncFetch`>> can be used to disable it globally; | ||
this system property is checked dynamically when the connection configuration is created. | ||
These properties are primarily intended for troubleshooting or workarounds if it turns out this feature has problems; | ||
they may be removed in a future Jaybird version once this feature has proven itself. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters