Details
-
Sub-Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Introduction of `Connection.setStatementTimeout(Duration)` methods.
spec:
== Limiting execution time for statements
The statement timeout can be configured on the `Connection` level allowing to associate the connection with a timeout limit.
By default there is no limit on the amount of time allowed for a running statement to complete unless specified through options.
The minimum amount of time can be used to either let the data source cancel the statement or attempt a client-side cancellation.
Once the data source has had an opportunity to process the request to terminate the running command, a `R2dbcTimeoutException` is raised to the client and no additional processing can occur against the previously running command without re-executing a statement.
The timeout applies to statements through a combination of `Statement#execute`, `Batch#execute` and `Result` consumption.
In the case of `Batch`/`Statement` batching, it is vendor-specific whether the timeout is applied to individual SQL commands or the entire batch.