Concurrency Control with Locks
Lock guarantees current transaction exclusive us of data item.
Acquires lock prior to access.
Lock released when transaction is completed.
A locking protocol is a set of rules followed by all transactions while requesting and releasing locks.
Locking protocols restrict the set of possible schedules.
Lock Granularity
Lock granularity indicates level of lock use: database,table,page,row, or field (attribute).
Database Level
The entire database is locked.
Good for batch processes,but unsuitable for online multi-user DBMSs.
Table Level
The entire table is locked.
If a transaction requires access to several tables,each table may be locked.
Table-level locks are not suitable for multi-user DBMSs
Page Level
A page has a fixed size and a table can span several pages while a page can contain several rows of one or more tables.
Page-level lock is currently the most frequently used multi-user DBMSs locking method.
Row Level
It allows concurrent transactions to access different rows of same table even if the rows are located on the same page.
It improves the availability of data,but requires high overhead cost for management.
Field Level
It allows concurrent transactions to access the same row, as long as they require the use of different fields.
The most flexible multi-user data access,but cost extremely high level of computer overhead.
Acquires lock prior to access.
Lock released when transaction is completed.
A locking protocol is a set of rules followed by all transactions while requesting and releasing locks.
Locking protocols restrict the set of possible schedules.
Lock Granularity
Lock granularity indicates level of lock use: database,table,page,row, or field (attribute).
Database Level
The entire database is locked.
Good for batch processes,but unsuitable for online multi-user DBMSs.
Table Level
The entire table is locked.
If a transaction requires access to several tables,each table may be locked.
Table-level locks are not suitable for multi-user DBMSs
Page Level
A page has a fixed size and a table can span several pages while a page can contain several rows of one or more tables.
Page-level lock is currently the most frequently used multi-user DBMSs locking method.
Row Level
It allows concurrent transactions to access different rows of same table even if the rows are located on the same page.
It improves the availability of data,but requires high overhead cost for management.
Field Level
It allows concurrent transactions to access the same row, as long as they require the use of different fields.
The most flexible multi-user data access,but cost extremely high level of computer overhead.
No comments