Question

2. Consider the following two transactions: (10 points) T13: read(A); read(B); if A = 1 then...

2. Consider the following two transactions: (10 points)
T13: read(A);
read(B);
if A = 1 then B := B - 1;
write(B).
T14: read(B);
read(A);
if B = 1 then A := A - 1;
write(A).
Let the consistency requirement be A = 1 or B = 1, with A = 1 and B = 1 as the initial values.
a. Show that every serial execution involving these two transactions preserves the consistency of the database.
b. Show a concurrent execution of T13 and T14 that produces a non serializable schedule.
c. Is there a concurrent execution of T13 and T14 that produces a serializable schedule?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

2). ANSWER:

GIVEN THAT:

T13 : read (*); read (B); if Azi then B:= 8-1; waite (B) T14: jead (6); Sead (A); it B-l then A:-A-1; Walite (A); V * Initial

Schedules TB Yead (A) Jead (6) read(6) slead() It is then B :: B-1 waite (6) A:-A-1 It B=1 then wolite (A) - Precedence graph

Add a comment
Know the answer?
Add Answer to:
2. Consider the following two transactions: (10 points) T13: read(A); read(B); if A = 1 then...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. Consider the following transactions: Assuming initial values of X-15 and Y-25, serializable schedules of these three...

    1. Consider the following transactions: Assuming initial values of X-15 and Y-25, serializable schedules of these three transactions can leave the database in various states. Determine all possible states of the database resulting from a serializable execution of S, T and U. Is the following schedule serial? serializable? recoverable? Show work. 2. 3. Is the following schedule serial? serializable? recoverable? Show work. Is the following schedule serial? serializable? recoverable? Show work. 4. 1. Consider the following transactions: Assuming initial values...

  • 1. What is the difference between Two-Phase Locking (2PL) and Strict Two-Phase Locking? What condition to Strict 2PL prevent that 2PL does not prevent? 2. What are deadlocks? What are two techniques...

    1. What is the difference between Two-Phase Locking (2PL) and Strict Two-Phase Locking? What condition to Strict 2PL prevent that 2PL does not prevent? 2. What are deadlocks? What are two techniques for detecting and resolving deadlocks? 3. In the figure below, R(X, y) means read database item X into variable y and W(X, y) means write variable y into database item y. Column T1 shows transaction T1's operations and column T2 shows T2's operations. Columns Aand_B show the values...

  • Q5: In DBMS, a graph precedence is used to test whether a schedule of concurrent transactions...

    Q5: In DBMS, a graph precedence is used to test whether a schedule of concurrent transactions is conflict serializable or not. Given the following schedule S with three transactions Ti T read(A) T; read(B) write(A) write(B) read(A) write(A) read(B) write(B) 1. Draw the precedence graph for the schedule S (5 points) 2. Check whether the schedule S conflict serializable or not (5 points) 3. Is it possible to construct a serial schedule S' which is conflict equivalent to the schedule...

  • Q5: In DBMS, a graph precedence is used to test whether a schedule of concurrent transactions...

    Q5: In DBMS, a graph precedence is used to test whether a schedule of concurrent transactions is conflict serializable or not. Given the following schedule S with three transactions T T3 T2 read(A) read(B) write(A) read(A) write(B) write(A) read(B) write(B) 1. Draw the precedence graph for the schedule S (5 points) 2. Check whether the schedule S conflict serializable or not (5 points] 3. Is it possible to construct a serial schedule S'which is conflict equivalent to the schedule S?...

  • 1. Consider the following schedule S TI T2 read(A) write(A write(A) write(A (a) Draw the precedence...

    1. Consider the following schedule S TI T2 read(A) write(A write(A) write(A (a) Draw the precedence graph of S (b) Is schedule S serializable? If so, name one equivalent serial schedule, and prove equivalence (c) Denote by S"the schedule obtained by replacing the write(A) in T2 with read(A) in S. Is schedule S" serializable? If so, name one equivalent serial schedule and prove equivalence. Otherwise prove that it is not. (d) Denote by S"the schedule obtained by replacing the write(A)...

  • 2. (20 POINTS) Given two schedules Si and S2 as follows: time begin transaction read(bal write(bal)...

    2. (20 POINTS) Given two schedules Si and S2 as follows: time begin transaction read(bal write(bal) begin transaction read(bal) write(bal) begin transaction read(bal) write(bal, begin_transaction read(bal read(baly) read(baly) write(baly) write(bal) wriebaly) commit commit read(baly) writebaly) read(baly) writebaly) 10 commit commit 12 Schedule Si Schedule S2 2.A.) (10 POINTS) Is Si serializable? Please show your work. 2.B.) (10 POINTS) Is S2 serializable? Please show your work.

  • For each of the following statements, circle T (True) or F (False) Serial execution of a...

    For each of the following statements, circle T (True) or F (False) Serial execution of a set of transactions is guaranteed to preserve database consistency. When using the two-phase locking protocol, two transactions can hold shared locks on the same data element at the same time. The recovery manager ensures the Atomicity property of a transaction by committing all operations of aborted transactions. A B+ tree index, that starts a root node, is rarely used in a relational database. Deadlocks...

  • Problem 2 (10 points): Consider the serial adder shown in Figure below. It uses two 4-bit...

    Problem 2 (10 points): Consider the serial adder shown in Figure below. It uses two 4-bit serial shift registers A and B. Initially, register A holds the binary number 0110 and register B holds 0011, while the carry flip-flop is reset to 0. Note that the serial input for shift register B is connected to the logic value zero Use the given table to list the binary values in register A, register B, the S signal, and the carry flip-flop...

  • Question 1: Assume that initially A-5 and B:10. The following are 3 transactions on A and...

    Question 1: Assume that initially A-5 and B:10. The following are 3 transactions on A and B (→ denotes assignmen): TI : A+B → A: A+B → B T2: A+B → B: A+B → A * For each transaction, a) add necessary read- and write-actions to the computation; b) show the undo/redo-log records for each of the transactions. Question 2: The following is a sequence of undo/redo-log records generated by two transactions, T and U: COMMIT U>:<T,E,50.51: <COMMIT T> Suppose...

  • 1. Answer the following questions related to Lecture 19 on registers and counters: . Consider the...

    1. Answer the following questions related to Lecture 19 on registers and counters: . Consider the serial adder on slide 10. Let registers A and B be bit shift registers, and assume that the Shift Control input is set to the "shift right" mode. Suppose that the initial contents of registers A, B, and the D flip flop are A-0110, B-0011, and Q-0. What are the contents of A, B and the D lip flop.. - after one clock edge....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT