Question

In: Computer Science

Consider the following history H: T2:R(Y), T1:R(X), T3:R(Y), T2:R(X), T2:W(Y), T2:Commit, T1:W(X), T1:Commit, T3:R(X), T3:Commit Assume...

Consider the following history H:

T2:R(Y), T1:R(X), T3:R(Y), T2:R(X), T2:W(Y), T2:Commit, T1:W(X), T1:Commit, T3:R(X), T3:Commit

Assume that each transaction is consistent.

Does the final database state satisfy all integrity constraints? Explain.

Solutions

Expert Solution

To preserve integrity transaction must satisfy ACID properties :

  1. Atomicity (A)
  2. Consistency (C)
  3. Isolation(I)
  4. Durability (D)

Generally, reading the data does not compromise the integrity. The integrity is compromised when a write operation is done without commit (means saving of the updated information).

Atomicity :

It means execute all operations of transaction including commit or execute none of the operations of transaction by the time of transaction termination.

In all the three transactions, T1, T2 and T3 first data is readed, that is, R(Y), R(X) and R(Y) respectively. So no compromise of atomicity till now.

Next, in transaction T2 X data is readed, that is also acceptable.

Now in T2 write operation is performed on Y that is W(Y), since no uncomitted operation in other transactions on Y till now so it is acceptable. Next the operation of T2 is comitted.

Now in T1 write operation is performed on X that is W(X), sinec no uncommitted operation till now on X so it is acceptable. After that transaction is comitted and all updates are saved.

Next in T3 read of X is done that is R(X) which is acceptable and comitted of the updates.

Since there are no dirty read and all the write operations are comitted without any error hence atomicity is followed in this history.

Consistency :

Consistency means the transaction does not have error done by users. It is given that the history is consistent.

Hence, this property also satisfies.

Isolation :

Isolation is satisfied if concurrent execution two or more transactions may be equal to result of any serial execution of transactions. (Serial schedule means transaction must execute one after other.)

It means any read or write operation performed in one transaction should not be impacted by other read and write in other transaction.

One of the serial schedule can be given as : T2 -> T1 -> T3 . In this the final value of X and Y is same as that of concurrent transaction.

Durability :

It means in case of any failure the transaction must be able to recover.

Since all the transactions are having commit after update then we can redo at that point. Hence, we can handle the scenario in case of failure and durability satisfies.

Since the history satisfies all the four ACID properties. Hence it satisfies all integrity constraints.


Related Solutions

Consider the following actions taken by transaction T1 on database objects X and Y: R(X), W(X),...
Consider the following actions taken by transaction T1 on database objects X and Y: R(X), W(X), R(Y), W(Y) Give an example of another transaction T2 that, if run concurrently to transaction T1 without some form of concurrency control, could interfere with T1.
Consider the parametric equations x = (t2 − 5) /(t2 + 1) , y = (t3 − 7t + 1) / (t2 + 1)
IN MATLABConsider the parametric equations x = (t2 − 5) /(t2 + 1) , y = (t3 − 7t + 1) / (t2 + 1)(a) Plot the curve for −8 ≤ t ≤ 8.(b) Determine the points on the graph where the slope of the tangent line is 2.(c) Determine the points on the graph where the graph has a horizontal tangent.
Consider the three transactions T1, T2, and T3, and the schedules S5 and S6 given below....
Consider the three transactions T1, T2, and T3, and the schedules S5 and S6 given below. Show all conflicts and draw the serializability (precedence) graphs for S5 and S6, and state whether each schedule is serializable or not. If a schedule is serializable, write down the equivalent serial schedule(s). T1: r1(x); r1(z); w1(x); T2: r2(z); r2(y); w2(z); w2(y); T3: r3(x); r3(y); w3(y); S5: r1(X); r2(Z); r1(Z); r3(X); r3(Y); w1(X); c1; w3(Y); c3; r2(Y); w2(Z); w2(Y); c2; S6: r1(X); r2(Z); r1(Z);...
Find the data hazards in the following code segment lw $t1,0($t1) addi $t1,$t1,100 or $t2,$t3,$t1 add...
Find the data hazards in the following code segment lw $t1,0($t1) addi $t1,$t1,100 or $t2,$t3,$t1 add $a0,$a1,$t2 ori $a0,$a0,42 add $t5,$a0,$t2 Reorder the following code segment to remove the data hazards. Assume that data forwarding takes place: lw $t0,24($a0) sub $t4,$t4,$t0 sub $t8,$t8,$t3 add $t6,$t6,$t5 mul $t7,$t7,$t1 What is the CPI for the reordered sequence of instructions in the preceding problem?
Three instructors in a coordinated course, T1, T2, and T3 evaluates axam papers. T1 evaluates 20%...
Three instructors in a coordinated course, T1, T2, and T3 evaluates axam papers. T1 evaluates 20% of the exam papers, T2 pevaluates 30% and T3 evaluates 50%. The three theachers make the following proportions of errors (E) while evaluating the exam papers: 0.008, 0.008, and 0.003 respectively. If a randomly selected exam paper has an error (E), what is the probability it is from instructor T1?
Consider the IVP t2y''−(t2 + 2)y' + (t + 2)y = t3 with y(1) = 0...
Consider the IVP t2y''−(t2 + 2)y' + (t + 2)y = t3 with y(1) = 0 and y'(1) = 0. • One function in the fundamental set of solutions is y1(t) = t. Find the second function y2(t) by setting y2(t) = w(t)y1(t) for w(t) to be determined. • Find the solution of the IVP
Consider the IVP t2y''−(t2 + 2)y' + (t + 2)y = t3 with y(1) = 0...
Consider the IVP t2y''−(t2 + 2)y' + (t + 2)y = t3 with y(1) = 0 and y'(1) = 0. • One function in the fundamental set of solutions is y1(t) = t. Find the second function y2(t) by setting y2(t) = w(t)y1(t) for w(t) to be determined. • Find the solution of the IVP
Let X, Y be two topological spaces. Prove that if both are T1 or T2 then...
Let X, Y be two topological spaces. Prove that if both are T1 or T2 then X × Y is the same in the product topology. Prove or find a counterexample for T0.
Consider the following code: lb $t0, 1($t1) sw $t0, 0($t2) Assume the followings. • The register...
Consider the following code: lb $t0, 1($t1) sw $t0, 0($t2) Assume the followings. • The register $t1 contains the content 0x1000,0000. • The word at memory address 0x1000,0000 is 0xAABB,CCDD. What value of the word is stored at the memory address pointed to by register $t2? Show the value of the word in hexadecimal.
Let X and Y be T2-space. Prove that X*Y is also T2
Let X and Y be T2-space. Prove that X*Y is also T2
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT