Skip to content

Glossary: Spring Boot Beyond the Basics

@Lock

Also written: Lock, LockModeType.PESSIMISTIC_WRITE, PESSIMISTIC_WRITE

An annotation for repository methods. With `PESSIMISTIC_WRITE`, Hibernate reads the row with `SELECT ... FOR UPDATE`, so a second order waits its turn.

Where the book teaches it

Related terms

Pessimistic locking