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
Retrying deadlocks can be done with the same IDbConnection, but retrying other transient errors necessitates a new IDbConnection, which is not something safely done automatically for anything but the first command, since there may be session state that needs to be retained.
ejball
changed the title
Support automatic retry
Support automatic deadlock retry
Oct 21, 2021
Reducing the scope of this issue to retrying deadlocks. RetryDeadlockDbConnector (or RetryTransactionDbConnector?) might be a better name. Throwing on BeginTransaction would create a pit of success. Needs #46.
A
RetryDbConnector
could retry operations on transient and/or deadlock exceptions.This would work well with
ExecuteTransaction
(#46) but not withBeginTransaction
etc. ShouldRetryDbConnector.BeginTransaction
throw?The settings should integrate well with
Polly
, ideally without taking a dependency on it.Expose a
Retry(Async)
method that allows the caller to create their own retry units?We would probably need protected overrides on
DbConnector
to which command operations would delegate so that we can retry queries.The text was updated successfully, but these errors were encountered: