Lock
Meaning in databases & SQL, with examples
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.
In Turkish: kilit
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
The batch job holds a lock on the inventory table for almost a minute.
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
Related terms
This word in other fields
The same English word can have a different meaning in another field:
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:
