Method WithConnectionLivenessCheckTimeout
WithConnectionLivenessCheckTimeout(TimeSpan)
Sets the connection liveness timeout. Pooled connections that have been idle in the pool for longer than this timeout will be tested before they are used again, to ensure they are still live. If this option is set too low, an additional network call will be incurred when acquiring a connection, which causes a performance hit.
If this is set high, you may receive sessions that are backed by no longer live connections, which will lead to exceptions in your application. Assuming the database is running, these exceptions will go away if you retry acquiring sessions. Hence, this parameter tunes a balance between the likelihood of your application seeing connection problems, and performance. You normally should not need to tune this parameter. No connection liveness check is done by default. Value 0 means connections will always be tested for validity. Values less than 0 are not allowed.public ConfigBuilder WithConnectionLivenessCheckTimeout(TimeSpan timeout)
Parameters
timeout
TimeSpanThe liveness timeout.
Returns
- ConfigBuilder
A ConfigBuilder instance for further configuration options.
Exceptions
- ArgumentOutOfRangeException
When
timeout
is less than Zero.