The Spring Boot race condition that sells your last unit twice
Two requests read “1 left”, both pass the check, both commit. Why @Transactional does not stop it, a test that proves it every time, and three fixes compared.
Two requests read “1 left”, both pass the check, both commit. Why @Transactional does not stop it, a test that proves it every time, and three fixes compared.
Each checkout holds one pooled connection and waits for a second. Why REQUIRES_NEW starves HikariCP under load, a test that proves it, and three fixes compared.