Draw a precedence graph for the following schedule that will represent any conflicting pairs of operations

computer science

Description

Question 1: 

i.         Draw a precedence graph for the following schedule that will represent any conflicting pairs of operations where for R1(X), R is a read operation, 1 is the transaction T1, and X is the data item X (so in this case the operation is  "Transaction T1 Reads X"):   R1(Y)W3(X)R2(Z)R1(Z)W4(Y)W4(X)W3(Z) 

ii.       Is this schedule conflict serializable? If not, what are the possible serial orderings that it is equivalent to?

iii.      The loosest form of the four standard transaction isolation levels is READ UNCOMMITTED, while the strictest is SERIALIZABLE.  Compare and contrast these levels with reference to problems that you may face with either.


Question 2:  A locking approach such as shared/exclusive locking, on its own does not guarantee conflict serializability. 

         i.            Describe an example of a transaction schedule where READ(X), WRITE(X) as well as READ_LOCK(X), WRITE_LOCK(X) and UNLOCK(X) operations are indicated for each transaction involved, showing and explaining how things can go wrong without the 2PL growing-shrinking ordering requirement.

       ii.            Define the terms referred to by the ACID acronym and for each property provide a high-level example of what can go wrong without it (e.g. an example of what might happen in a database system if transactions are NOT run as atomic units (Atomicity), etc.

 

 Question 3:  Consider the following sequence of 10 interleaved operations by two transactions T1 and T2 (assume no other transactions are running). Data item X begins with the value 40

1.       T1 START TRANSACTION

2.       T2 START TRANSACTION

3.       T1 X = READ(X)

4.       T2 X = READ(X)

5.       T1 X = X + 30

6.       T2 X = X - 5

7.       T1 WRITE(X)

8.       T2 WRITE(X)

9.       T1 COMMIT

10.   T2 COMMIT

Outline what you expect will happen if these attempts to execute in the following environments:

·         2PL where every READ gets a shared lock. 

·         2PL but with non-locking reads (e.g. with MySQL MVCC-based default settings) 

A timestamping approach as described in this week's lesson.


Related Questions in computer science category