DBMS Presentation - Concurrency Control
DBMS Presentation - Concurrency Control
The older transaction is always given priority in this method. It uses system time to
determine the time stamp of the transaction. This is the most commonly used
concurrency protocol.
Lock-based protocols help you to manage the order between the conflicting
transactions when they will execute. Timestamp-based protocols manage conflicts as
soon as an operation is created.
A timestamp is a tag that can be attached to any transaction or any data item, which
denotes specific time on which the data item had been activated in any way.
Example
Suppose there are there transactions T1, T2, and T3.
T1 has entered the system at time 0010 – 100(older)
T2 has entered the system at 0020 – 200(younger)
T3 has entered the system at 0030 – 300(youngest)
Priority will be given to transaction T1, then transaction T2 and
lastly Transaction T3.
• Ts (T1) - 100
• Ts (T2) - 200
• Ts (T3) - 300
Types of Timestamp
Read_Ts (RTS): Write_Ts (WTS):
• Last (latest) transaction • Last (latest) transaction
no. which Performed Read no. Which Performed Write
Successfully. So, here Successfully. So, here
RTS(A)T1= 300
T2 T3 WTS(A) T1
= 200T2 T3
W(A) R(A)
W(A) R(A)
W(A) R(A)
100 200 300 100 200 300
• Transaction T1 issues a
Read(A) operation
1. If WTS(A) > TS(T1), Rollback T1
2. Otherwise execute R(A) operation
Set RTS(A) = Max
Rules
{RTS(A), TS(T1)}
Disadvantages:
Starvation is possible if the same transaction
Bibliography
1. Slideshare.com
2. www.google.com
3. www.geeksforgeeks.com
Thank You