Question: Transaction Processing Consider the following oversimplified schema for a database to store a social network of friends and the Web pages they like. CREATE TABLE

 Transaction Processing Consider the following oversimplified schema for a database to

Transaction Processing Consider the following oversimplified schema for a database to store a social network of friends and the Web pages they like. CREATE TABLE Friend (uid1 int, uid2 int); CREATE TABLE Likes (uid int, URL char (120)); CREATE VIEW LikeCount AS SELECT uid, count (*) AS cnt FROM Likes GROUP BY uid; Consider the following transactions: T1: SELECT count (*) FROM Likes WHERE uid-1234 T2 INSERT INTO Likes (uid, URL) VALUES (1234, "") T3 SELECT cnt FROM LikeCount WHERE uid-1234 (1234, "URL2>"; Suppose the scheduler accepts the three transactions at the same time, and assigns their start time as follows: start(T)=t; start(T)=t+1; start(Ta)=t+2, form some timestamp t. (13) (2 marks) Describe a concurrency control mechanism and a sequence of events that when applied to the scenario above would allow the three transactions to execute concurrently, COMMIT in the absence of system failures, and in a way that the values returned by T1 and T3 are the same. Your answer can involve any of the mechanisms discussed in class. Transaction Processing Consider the following oversimplified schema for a database to store a social network of friends and the Web pages they like. CREATE TABLE Friend (uid1 int, uid2 int); CREATE TABLE Likes (uid int, URL char (120)); CREATE VIEW LikeCount AS SELECT uid, count (*) AS cnt FROM Likes GROUP BY uid; Consider the following transactions: T1: SELECT count (*) FROM Likes WHERE uid-1234 T2 INSERT INTO Likes (uid, URL) VALUES (1234, "") T3 SELECT cnt FROM LikeCount WHERE uid-1234 (1234, "URL2>"; Suppose the scheduler accepts the three transactions at the same time, and assigns their start time as follows: start(T)=t; start(T)=t+1; start(Ta)=t+2, form some timestamp t. (13) (2 marks) Describe a concurrency control mechanism and a sequence of events that when applied to the scenario above would allow the three transactions to execute concurrently, COMMIT in the absence of system failures, and in a way that the values returned by T1 and T3 are the same. Your answer can involve any of the mechanisms discussed in class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!