You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Knowledge check: Transactions and Concurrency Control
What is the result of the following database transaction if the initial values of both A and B is 100?
BEGIN
A=A+100
B=A+100
END
A=200, B=300 Explanation : A = 100 + 100 = 200 B = 200 + 100 = 300
Consider the following two database transactions with initial values of A=500 and B=500:
T1: A=A+100, B=A-100
T2: A=A1.06, B=B1.06
Assuming T1 arrives first, what will be the final values of A and B if the two transactions are processed using a serial schedule?
A=636, B=530
In a serial schedule, T1 is processed in its entirety first and then T2 is processed. T1: A = 500 + 100 = 600 B = 600 - 100 = 500 T2: A = 600 * 1.06 = 636 B = 500 * 1.06 = 530
Consider the following two database transactions with initial values of A=500 and B=500:
T1: A=A+100, B=A-100
T2: A=A1.06, B=B1.06
Assuming T1 arrives first, what will be the final values of A and B if the database management system interleaves transactions?
A=636, B=568.16
Starting with T1 and then interleaving after the first part to T1, these are the final values of A and B.
T1: A = 500 + 100 = 600 T2: A = 600 * 1.06 = 636 T1: B = 636 - 100 = 536 T2: B = 536 * 1.06 = 568.16
The text was updated successfully, but these errors were encountered:
Lesson Introduction: ACID Properties
Topic: Principles of Transactions: ACID Properties
Atomicity:
Consistency
Isolation (Transacation are isolated or protected)
Durability
A transaction is seen by DBMS as a series, or list of actions. The action can read and write
Knowledge Check: ACID Properties
Topic: Concurrency Control
We call such interleave - Schedule
Serial Schedule
Equivalent Schedule
Serializable Schedule
Conflict Serializable Schedules
Two schedules are conflict equivalent if
Schedule S is conflict serializable if S is conflict equivalent to some serial schedule
Dependency Graph
🔼 This is serialiazble
🔼 This is not conflict serializable
🔼 This is not serializable T1 => T2 (R(A), W(A)) T2 => T1 (R(B), W(B))
Example
Knowledge check: Transactions and Concurrency Control
BEGIN
A=A+100
B=A+100
END
Explanation : A = 100 + 100 = 200 B = 200 + 100 = 300
T1: A=A+100, B=A-100
T2: A=A1.06, B=B1.06
Assuming T1 arrives first, what will be the final values of A and B if the two transactions are processed using a serial schedule?
In a serial schedule, T1 is processed in its entirety first and then T2 is processed.
T1: A = 500 + 100 = 600 B = 600 - 100 = 500
T2: A = 600 * 1.06 = 636 B = 500 * 1.06 = 530
T1: A=A+100, B=A-100
T2: A=A1.06, B=B1.06
Assuming T1 arrives first, what will be the final values of A and B if the database management system interleaves transactions?
Starting with T1 and then interleaving after the first part to T1, these are the final values of A and B.
T1: A = 500 + 100 = 600 T2: A = 600 * 1.06 = 636 T1: B = 636 - 100 = 536 T2: B = 536 * 1.06 = 568.16
The text was updated successfully, but these errors were encountered: