Recruiter, software, contract, business, systems, developer, analyst, hardware, technical interview questions, staffing agency

What is a lock? How does it work?


A lock gives a transaction exclusive use of a data item for the duration of the transaction. This is important so you do not run into concurrency control issues where two or more users are trying to perform queries on the same set of data. There are several levels of locks known as lock granularity starting with the database-level lock that prevents access to the entire database, this is followed by the table level lock that locks an entire table, a page level lock locks a disk page and is the most frequently used DBMS locking device. A row level lock locks the row, while the field level lock allows transactions to access the same row.

Share/Save/Bookmark

Leave a Reply