🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Spring Boot Interview Questions: all 10 questions

Quiz: Spring Boot Interview Questions · Question 7 of 10

When is optimistic locking (a @Version column) a better choice than pessimistic locking?

When is optimistic locking (a @Version column) a better choice than pessimistic locking?

  1. A.When conflicts happen on almost every update
  2. B.When the database has no indexes
  3. C.When conflicts are rare, so locking rows on every read would waste time
  4. D.Never; pessimistic locking is always better
Answer & explanation

Correct answer: When conflicts are rare, so locking rows on every read would waste time

Optimistic locking detects a conflict at update time instead of blocking readers.

Can you get the rest right without peeking?

Take the timed Quiz: Spring Boot Interview Questions quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →