What does lock mean?

In databases & SQL, lock means a mark the database places on a row, page or table so that other transactions cannot change it, or sometimes read it, until the current transaction ends.

lɑːknounCommon term

Databases & SQL vocabulary · Transactions and Concurrency

In Turkish: kilit

Also used in: Software Engineering

How it is used

Locks can be row-level or table-level, and shared (for reading) or exclusive (for writing). People say a query 'takes', 'holds', 'waits for' or 'releases' a lock. Long-held locks cause blocking and timeouts, so DBAs monitor lock waits closely.

Example sentences

  1. The batch job holds a lock on the inventory table for almost a minute.

  2. Use SELECT ... FOR UPDATE to lock the row before you change the balance.

Common collocations

  • hold a lock
  • release a lock
  • row-level lock
  • lock wait
  • lock timeout

More terms: Transactions and Concurrency

Practise with graded reading

Reading at the right level is the fastest way to make new words stick. Pick free English books by level: