Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Goal of this task is to provide non jdbc async methods.
Driver must then be driven by event, based on java AsynchronousSocketChannel. Those async method has then to return CompletableFuture results, to permit returning results/exception and permit chaining execution.
example :
standard JDBC method ResultSet executeQuery(String sql) will have a corresponding async method :
CompletableFuture<Boolean> executeAsync(String sql)
Relying on AsynchronousSocketChannel avoid having just another thread pool but use a java internal thread pool that will have threads only when data has to be send/received.
Server will still execute query one after another, driver has to send commands one after the other, but without waiting for previous query answer. Relying on FIFO order, when server for a connection finish command, next one might already be in TCP buffer.
Driver has to prioritize reading socket to avoid having client and server TCP buffer full, locking exchanges.