Consider the following actions taken by transaction T1 on database objects X and
ID: 3868566 • Letter: C
Question
Consider the following actions taken by transaction T1 on database objects X and Y: R (X), W (X), W (Y) 1. Give an example of another transaction T2 that, if run concurrently to transaction T without some form of concurrency control, could interfere with T1. 2. Explain how the use of Strict 2PL would prevent interference between the two transactions. 3. Strict 2PL is used in many database systems. Give two reasons for its popularity. Consider the following classes of schedules: conflict-serializable (a), recoverable (b), and avoids-cascading-aborts (c). For each of the following schedules, state which of the preceding classes it belongs to. If you cannot decide whether a schedule belongs in a certain class based on the listed actions, explain briefly. The actions are listed in the order they are scheduled and prefixed with the transaction name. If a commit or abort is not shown, the schedule is incomplete: assume that abort or commit must follow all the listed actions. For simplicity, you should answer the questions in the following way. For example, you say a schedule is conflict-serializable (a), but not recoverable (b), and cannot decide avoids-cascading-aborts (c), Your answer is: YNU, where Y is Yes, N is No, U is unknown. 1. T1: R (X), T2: R (X), T1: W (X), T2: W (X) 2. T1: W (X), T2: R (Y), T1: R (Y), T2: R (X) 3.T1: K (X), T2: R (Y), T3: W (X), T2: K (X), T1: R (Y) 4. T1: R (X). T1: R (Y), T1: W (X), T2: R (Y), T3: W (Y), T1: W (X). T2: R (Y) 5. T1: R (X), T2: W (X), TI: W (X), T2: Abort, T1: Commit 6. T1: R (X), P2: W (X), T1: W (X), T2: Commit, T1: Commit 7. T1: W (X), T2: R (X), T1: W (X), T2: Abort, T1: Commit 8. T1: W (X), T2: R (X), TI: W (X), T2: Commit, T1: Commit 9. T1: W (X), T2: R(X), T1: W (X), T2: Commit, T1: Abort 10. T2: R (X), T3: W (X), T3: Commit T1: W (Y), T1: Commit, 72: R (Y), T2: W (Z), T2: Commit 11. TI: R (X), T2: W (X), T2: Commit, TI: W (X), TL: Commit, T3: R (X), T3: Commit 12. T1: R (X), T2: W (X), T1: W (X), T3: R (X), T1: Commit, T2: Commit. T3: Commit-Sequence S1: T1: R (X), T2: W (X), T2: W (Y), T3: W (Y), T1: W (Y), T1: Commit, T2: Commit, T3: Commit Sequence S2: T1: R (X), T2: W (Y), T2: W (X), T3: W (Y), T1: W (Y), T1: Commit, T2: Commit, T3: Commit For each sequence and for each of the following concurrency control mechanisms, describe how the concurrency control mechanism handles the sequence. Assume that the timestamp of transaction Ti is i. For lock-based concurrency control mechanisms, add lock and unlock requests to the previous sequence of actions as per the locking protocol. The DBMS processes actions in the order shown. If a transaction is blocked, assume that all its actions are queued until it is resumed: the DBMS continues with the next action (according to the listed sequence) of an unblocked transaction. 1. Strict 2PL with timestamps used for deadlock prevention (using Wait-Die policy). 2. Strict 2PT. with deadlock detection. (Show the waits-for graph in case of deadlock.) 3. Optimistic concurrency control. 4. Timestamp concurrency control with buffering of reads and writes (to ensure recoverability) and the Thomas Write Rule. 5. Multiversion timestamp concurrency control. Briefly answer the following questions: 1. What are the properties required of LSNs? 2. What are the fields in an update log record? Explain the use of each field. 3. What are red cable log records? 4. What are the differences between update log records and CLRs? Consider the execution shown in the figure. 1. Extend the figure to show prevLSN and undonextLSN values. 2. Describe the actions taken to rollback transaction T2. 3. Show the log after T2 is rolled back, including all prevLSN and undonexlLSN values in log records.Explanation / Answer
Try to break down your question into parts and then post, I can only answer the first one. Here goes:
1. T2 can have many variants one can be W(X),W(Y),R(X)
So, in this case when let's say T1 reads X while T2 write to X. Now, if there is no concurrency control then it might be possible that T1 doesn't get the updated value.
2. Strict 2PL actually provides with two things: S(shared) and X(exclusive) lock. Before reading, one must acquire S and before writing one must acquire X. Locks are released only when the transaction completes. Now, in our case we T2 is going to write X then it has to acquire X(exclusive) lock and when a transaction has X lock on an object then no other transaction can get any lock on it. So, in this way T1 waits and gets the updated value.
3. The reason why Strict 2PL is very popular is because:
(i) It ensures serializability
(ii) It ensures strict recoverable schedule
Do comment for further doubts :)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.