Concurrency Gone Wrong: Fixing Lost Updates with Database Locking
1d ago · 4 min read · Hello, today i am going to deep dive into optimistic and pessimistic locking from a database perspective. First, let's look at the following example:
DO $$
DECLARE
current_stock INT;
BEGIN
SEL