DBMS Concurrency Control
DBMS Concurrency Control
HOME
JAVA
PHP
Python
Ruby
Perl
HTML
CSS
Javascript
MySQL
C++
UNIX
MORE...
Previous Page
DBMS Tutorial
DBMS Home
DBMS Overview
DBMS Architecture
DBMS Data Models
DBMS Data Schemas
DBMS Data Independence
Database systems, which are equipped with lock-based protocols, use mechanism b
transaction cannot read or write data until it acquires appropriate lock on it first. Locks are o
Binary Locks: a lock on data item can be in two states; it is either locked or unlocked
Simplistic
ER Diagram Representation
Generalization, Aggregation
Simplistic lock based protocols allow transaction to obtain lock on every object b
operation is performed. As soon as 'write' has been done, transactions may unlo
item.
Relational Model
Pre-claiming
[Image: Pre-claiming]
Two Phase Locking - 2PL
This locking protocol is divides transaction execution phase into three parts.
when transaction starts executing, transaction seeks grant for locks it needs as
Second part is where the transaction acquires all locks and no other lock
Transaction keeps executing its operation. As soon as the transaction releases its f
third phase starts. In this phase a transaction cannot demand for any lock but only r
http://www.tutorialspoint.com/dbms/dbms_concurrency_control.htm
1/3
6/10/2014
acquired locks.
Transaction And
Concurrency
DBMS Transaction
Two phase locking has two phases, one is growing; where all locks are being
transaction and second one is shrinking, where locks held by the transaction
released.
To claim an exclusive (write) lock, a transaction must first acquire a shared (read) lo
upgrade it to exclusive lock.
Strict Two Phase Locking
The first phase of Strict-2PL is same as 2PL. After acquiring all locks in the
transaction continues to execute normally. But in contrast to 2PL, Strict-2PL does
lock as soon as it is no more required, but it holds all locks until commit state arrive
releases all locks at once at commit point.
The most commonly used concurrency protocol is time-stamp based protocol. This pr
either system time or logical counter to be used as a time-stamp.
Lock based protocols manage the order between conflicting pairs among transaction a
execution whereas time-stamp based protocols start working as soon as transaction is cre
Selected Reading
Developer's Best Practices
Effective Resume Writing
Computer Glossary
Who is Who
Every transaction has a time-stamp associated with it and the ordering is determined by th
transaction. A transaction created at 0002 clock time would be older than all other transa
come after it. For example, any transaction 'y' entering the system at 0004 is two seconds
priority may be given to the older one.
In addition, every data item is given the latest read and write-timestamp. This lets the sy
when was last read and write operation made on the data item.
2/3
6/10/2014
Operation rejected.
If TS(Ti) < W-timestamp(X)
Operation rejected and Ti rolled back.
Otherwise, operation executed.
Operation rejected and Ti rolled back. Timestamp ordering rules can be modified to m
schedule view serializable. Instead of making Ti rolled back, the 'write' operation itse
Previous Page
Print Version
Advertisements
ASP.NET | jQuery | AJAX | ANT | JSP | Servlets | log4j | iBATIS | Hibernate | JDBC | Struts |
http://www.tutorialspoint.com/dbms/dbms_concurrency_control.htm
3/3