select for update

An SQL query that reads rows and locks them for the rest of the transaction.

In more detail

It is how a transaction takes a row lock on the read, so a second buyer waits and then sees the seat is gone. Other transactions trying to lock or update those rows wait until the first one finishes.

Related terms

Taught in

References