Que5.9. Write the salient features of graph grounded locking protocol with suitable illustration. Answer Salient features of graph grounded locking protocol are 1. The graph grounded locking protocol ensures conflict serializability. 2. Free from impasse. 3. unleashing may do before in the graph grounded locking protocol than in the two phase locking protocol. 4. Shorter waiting time, and increase in concurrency. 5. No rollbacks are needed. 6. Data particulars may be uncorked at any time. 7. Only exclusive cinches are considered. 8. The first cinch by T1 may be on any data item. latterly, a data Q can be locked by T1 only if the parent of Q is presently locked by T1. 9. A data item that has been locked and uncorked by T1 can not latterly be relocked by T1. For illustration We’ve three deals in this schedule, i.e., we will only see how locking and unlocking of data item. Que5.10. Describe two- phase locking fashion for concurrency control. Explain. How does it guarantee serializability? Answer Two- phase locking fashion ReferQ.5.7, Page 5 – 6A, Unit- 5. Two- phase locking guarantee the serializability 1. Two- phase locking protocol restricts the unwanted read/ write by applying exclusive cinch. 2. also, when there’s an exclusive cinch on an item it’ll only be released in shrinking phase. 3. Due to this restriction, there’s no chance of getting any inconsistent state. Because any inconsistency may only be created by write operation. In this way the two- phase locking protocol ensures serializability. Que5.11. Describe major problems associated with concurrent processing with exemplifications. What’s the part of cinches in avoiding these problems? OR Describe the problem faced when concurrent deals are executing in unbridled manner. Give an illustration and explain. Answer Concurrent sale Concurrent sale means multiple deals are active at the same time. Following problems can arise if numerous deals try to pierce a common database contemporaneously 1. The lost update problem a. A alternate sale writes a alternate value of a data item on top of a first value written by a first concurrent sale, and the first value is lost to other deals running coincidently which need, by their priority, to read the first value. b. The deals that have read the wrong value end with incorrect results. 2. The dirty read problem Deals read a value written by a sale that has been latterly abandoned. b. This value disappears from the database upon repeal, and should not have been read by any sale( “ dirty read ”). c. The reading deals end with incorrect results. In the illustration, sale T1 fails and changes the value of X back to its old value, but T2 is committed and reads the temporary incorrect value ofX. 3. The incorrect summary problem a. While one sale takes a summary over the values of all the cases of a repeated data item, a alternate sale updates some cases of that data item. b. The performing summary doesn’t reflect a correct result for any generally demanded for correctness) priority order betw An illustration of unrepeatable read in which if T1 were to read the value of X after T2 had streamlined X, the result of T1 would be different. part of cinches 1. It locks the data item in the sale in correct order. 2. If any data item is locked than it must be unlock at the end of operation. Que5.12. Explain timestamp grounded protocol and timestamp ordering protocol. OR bandy the timestamp grounded protocol to maintain serializability in concurrent prosecution. Also explain its advantages and disadvantages. Answer Timestamp grounded protocols Timestamp grounded protocol ensures serializability. It selects an ordering among deals in advance using timestamps. Timestamps 1. With each sale in the system, a unique fixed timestamp is associated. It’s denoted by TS( Ti). 2. This timestamp is assigned by the database system before the sale Ti starts prosecution. 3. still, and a new If a sale Ti has been assigned timestamp TS( Ti). sale Tj enters the system, also TS( Ti)< TS( Tj). 4. The timestamps of the deals determine the serializability order. therefore, if TS( Tj)> TS( Ti), also the system must insure that in produced schedule, sale Ti appears before sale Tj. 5. To apply this scheme, two timestamps are associated with each data itemQ. W- timestamp( Q) It denotes the largest timestamp of any sale that executed write( Q) successfully. R- timestamp( Q) It denotes the largest timestamp of any sale that executed read( Q) successfully. These timestamps are streamlined whenever a new read( Q) or write( Q) instruction is executed. The timestamp ordering protocol The timestamp ordering protocol ensures that any disagreeing read and write operations are executed in timestamp order. This protocol operates as follows 1. Suppose that sale Ti issues read( Q). , also Ti needs a value of Q that was If TS( Ti)< W- timestamp( Q). formerly overwritten. Hence, read operation is rejected, and Ti is rolledback. , also the read operation is executed, If TS( Ti) W- timestamp( Q). and R- timestamp( Q) is set to the outside of R- timestamp( Q) and TS( Ti). 2. Suppose that sale Ti issues write( Q). , also the value of Q that Ti is producing If TS( Ti)< R- timestamp( Q). was demanded preliminarily, and the system assumed that the value would noway be produced. Hence, the system rejects write operation and rolls Ti back. , also Ti is trying to write an If TS( Ti)< W- timestamp( Q). obsolete value ofQ. Hence, the system rejects this write operation and rolls back Ti. else, the system executes the write operation and sets W- timestamp( Q) to TS( Ti). If a sale Ti is rolled by the concurrency control scheme, the system assigns it a new timestamp and restarts it. Advantages of timestamp ordering protocol 1. The timestamp ordering protocol ensures conflict serializability. This is because clashing operation are reused in timestamp order. 2. The protocol ensures freedom from impasse, since no sale ever delays. Disadvantages of timestamp ordering protocol 1. There’s a possibility of starvation of long sale if a sequence of disagreeing short sale causes repeated resuming of the long sale. 2. The protocol can induce schedules that aren’t recoverable. Que5.13. Write short note on the following Thomas ’ write rule ii. Strict timestamp ordering protocol Answer Thomas ’ write rule Thomas ’ write rule is a modified interpretation of timestamp ordering protocol. Suppose that sale Ti issues write( Q) 1. still, also the value of Q that Ti is producing If TS( Ti)< R- timestamp( Q). was preliminarily demanded, and it had been assumed that the value would noway be produced. Hence, the system rejects the write operation and rolls Ti back. 2. still, also Ti is trying to write an obsolete If TS( Ti)< W- timestamp( Q). value ofQ. Hence, this write operation can be ignored. 3. else, the system executes the write operation and sets W- timestamps( Q) to TS( Ti). ii. Strict timestamp ordering protocol 1. Strict timestamp ordering ensures that the schedules are both strict and serializable. 2. In this variation, a sale T issues aread_item( X) or ( X) similar that TS( T)> W- timestamp( X) has its read or write operation delayed until the sale T1 that wrote the value of X hence TS( T1) = W- timestamp( X)) has committed or abandoned. 3. To apply this algorithm, it’s necessary to pretend the locking of an item X that has been written by sale T until T1 is either married or aborted. 4. This algorithm doesn’t beget impasse, since T delays for T1 only if TS( T)> TS( T1). Que5.14. Explain confirmation protocol in concurrency control. Answer confirmation protocol in concurrency control consists of following three phase 1. Read phase a. During this phase, the system executes sale Ti. b. It reads the values of the colorful data particulars and stores them in variables original to Ti. c. It performs all write operations on temporary original variables, without updates of the factual database. 2. confirmation phase sale Ti performs a confirmation test to determine whether it can copy to the database, the temporary original variables that hold the results of write operations without causing a violation of serializability. 3. Write phase If sale Ti succeeds in confirmation phase, also the system applies the factual updates to the database, else, the system rolls back Ti. All three phases of coincidently executing deals can be interleaved. To perform the confirmation test, we should know when the colorful phases of deals Ti took place. We shall, thus, associate three different timestamps with sale Ti 1. launch( Ti), the time when Ti started its prosecution. 2. confirmation( Ti), the time when Ti finished its read phase and started its confirmation phase. 3. Finish( Ti), the time when Ti finished its write phase.