Overview
SQL Retry Policy
Configuration of the custom SqlMapper (Wuic.Webcore) retry policy for read operations.
This section controls the retry behavior on transient errors (timeout, deadlock, lock timeout, temporary network/provider errors).
SqlMapperRetry Section
Recommended snippet:
"SqlMapperRetry": {
"Enabled": true,
"MaxAttempts": 3,
"BaseDelayMs": 100,
"UseJitter": true,
"RetryReadOperationsOnly": true,
"RetryOnTransaction": falseOptions
Enabled
- Enables/disables the retry policy.
- Values: true | false.
- Default: true.
MaxAttempts
- Maximum total number of attempts (initial attempt included).
- Values: positive integer (>= 1).
- Default: 3.
BaseDelayMs
- Base delay in milliseconds used for exponential backoff between attempts.
- Values: positive integer.
- Default: 100.
UseJitter
- Adds a random component (jitter) to the delay to reduce synchronized retries.
- Values: true | false.
- Default: true.
RetryReadOperationsOnly
- If true, applies retry only to read operations (Query, QueryMultiple, MultiMap, ExecuteScalar on read-only SQL).
- Values: true | false.
- Default: true.
RetryOnTransaction
- If false, disables retry when an active transaction is present.
- Values: true | false.
- Default: false.
Operational Behavior
- On first-attempt success, no extra latency is introduced.
- Retry intervenes only on errors classified as transient.
- If the error is not transient, it is immediately rethrown.
- With
RetryReadOperationsOnly=true, write paths (Execute/ExecuteNonQuery) are not retried to avoid duplicate side effects.