3 ms·
Not quite. Databases use both branching and locking. Two transactions that conflict can cause one thread to block, rather than rolling back. SELECT followed by
by Animats 8mo ago
Not quite. Databases use both branching and locking. Two transactions that conflict can cause one thread to block, rather than rolling back.
SELECT followed by an update is the most usual case for a block. (I have to code one today, and I want to see if I can rewrite it as one MySQL statement.)
- rmunn 8mo agoYes, the analogy isn't perfect. I didn't want to get into all the subtleties in an introductory analogy, but I should probably have mentioned blocking. Too late for me to edit my post with your correction, though.