Troubleshooting — EricksonLopez.Concurrency
Common failure modes when adopting EricksonLopez.Concurrency (2.0.0).
default(ExpectedVersion) Evaluates to Specific(0)
Section titled “default(ExpectedVersion) Evaluates to Specific(0)”- Symptom: Version checks unexpectedly fail for existing rows when
ExpectedVersionwas omitted or left asdefault. - Fix: Explicitly pass
ExpectedVersion.Any,ExpectedVersion.Exists, orExpectedVersion.Specific(v).
- Reentrancy (
v2.0.0): CallingExecuteCasAsyncrecursively inside its ownmutatedelegate triggers theAsyncLocalnon-reentrancy guard. Refactor nested updates into sequential CAS operations. - Blank
entityId:ExecuteCasAsyncandExecuteOptimisticAsyncenforceArgumentException.ThrowIfNullOrWhiteSpace(entityId).
Result vs EricksonLopez.Concurrency.Result Ambiguity
Section titled “Result vs EricksonLopez.Concurrency.Result Ambiguity”- Symptom: Compiler resolves
Resultto namespaceEricksonLopez.Concurrency.Resultinstead ofEricksonLopez.Result.Result. - Fix: Add
using ResultOutcome = EricksonLopez.Result.Result;in files importingEricksonLopez.Concurrency.Result.