Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following interleaving of four transactions with the initial values: bal x = 100 bal y = 200 bal z = 300 T 1

Consider the following interleaving of four transactions with the initial values: balx = 100 baly = 200 balz = 300

T1 T2 T3 T4
begin_transaction begin_transaction begin_transaction begin_transaction
read(balx) read(baly) read(balz) sum = 0
balx = balx + 100 baly = baly - 10 balz = balz + 50 read(balz)
write(balx) write(baly) write(balz) sum = sum + balz
read(baly) read(balz) commit read(baly)
baly = baly - 100 balz = balz + 10 sum = sum + baly
write(baly) write(balz) read(balx)
commit commit sum = sum + balx
commit

a)If the transactions were permitted to run as shown, what would be the final values of balx, baly, balz, and sum?

b)Assuming appropriate use of rigorous 2-Phase Locking, and assuming priority on gaining locks is from left to right, and it takes one time step to gain / release locks, show the interleaving of the transactions over time.

c)What are the final values of balx, baly, balz, and sum?

d)Repeat parts (b) and (c) if transaction T2 performs a rollback instead of a commit.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students also viewed these Databases questions

Question

What would you do if the bullies were in your classes?

Answered: 1 week ago

Question

4. Identify cultural variations in communication style.

Answered: 1 week ago

Question

9. Understand the phenomenon of code switching and interlanguage.

Answered: 1 week ago

Question

8. Explain the difference between translation and interpretation.

Answered: 1 week ago