You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: add internal option for statement executor type (#3534)
The Connection API by default uses either a platform thread or a virtual thread
for each connection to execute and control the statements of that connection. This
is used to enable asynchronous execution of statements and allows a statement to
be cancelled by just interrupting this thread. Both these use cases are however
not (or only very rarely) used by the most common users of the Connection API;
the JDBC driver and PGAdapter. PGAdapter uses the PostgreSQL wire-protocol, which
by design is synchronous, and JDBC is also a synchronous API. The latter has a
cancel() method that currently requires this threading model, but this can be
modified in the JDBC driver.
Using a direct executor instead of a single-threaded executor per connection can
save one thread per connection.
The option is intentionally made package-private, so the above-mentioned
frameworks can set it by default without it becoming part of the public API.
0 commit comments