Concurrency exceptions in Entity Framework

asked12 years ago
last updated12 years ago
viewed24.5k times
Up Vote24Down Vote

When calling SaveChanges / SaveChangesAsync in Entity Framework (CF, C#), if a change conflict occurs (for example, the values has been updated since last read thingy), then which of these two exceptions DbUpdateConcurrencyException OR OptimisticConcurrencyException shall I catch?

And what is the difference between them?