advancedDatabase453 of 469

Two transactions read one row, both update it, and one update vanishes (or two threads update the same record). What prevents it?

Tests whether you name the lost-update problem by name and reach for either a higher isolation level/row locking (SELECT ... FOR UPDATE) or optimistic locking with a version column, rather than application-level synchronization, which doesn't protect DB state across instances.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

← Back to all Spring Boot & Microservices questions