Enum ConflictKind
- Namespace
- DynaSharp
- Assembly
- DynaSharp.dll
Which lost races RetryOnConflictAsync<TResult>(Func<CancellationToken, ValueTask<TResult>>, ConflictKind, int, CancellationToken) runs its delegate again on. Without it, a retry takes Any.
[Flags]
public enum ConflictKind
Fields
ConditionalCheckFailed = 1A failed condition: a ConditionalCheckFailedException, or a TransactionCanceledException with ConditionalCheckFailed among its reasons. This is what optimistic locking loses with, where the run reads the new version and writes again.
TransactionConflict = 2A transaction in the way: a TransactionConflictException, which a write outside a transaction gets on an item a transaction holds, or a TransactionCanceledException with TransactionConflict among its reasons. The item may be what the run expects once the other one is done.
Any = ConditionalCheckFailed | TransactionConflictBoth, which is what the overloads without a ConflictKind retry.
Remarks
A failed condition and a transaction in the way are different answers. A failed condition says that the item is not what the run expected, which a version check expects to see again after another writer got through, and which can also be the answer itself, such as an address that is taken. A transaction in the way says nothing about the item: only asking again tells. A run that turns every failed condition into its result, or whose failed condition is an answer that asking again does not change, wants TransactionConflict alone.