Optimistic vs pessimistic concurrency in EF Core, explained with a wallet balance
Two withdrawals read the same balance and both succeed: that's a race condition. Three ways to stop it in EF Core (rowversion, an atomic update, and a row lock) and when to use each.