Isolation levels, write skew and retrying on 40001
Two doctors on call, each checks that the other is there and goes home. Watch Read Committed and Repeatable Read both allow it, Serializable refuse it, and what the app must do when it does.
Checking your access…