LOVELY PROFESSIONAL UNIVERSITY Homework Title/No. : ____4____ Course Instructor: Lect.

Chavi Ralhan Date of Allotment: Student’s Roll No. :__A12____ Course Code: ____CSE (301) _______ Course Tutor (if applicable):_______ Date of submission: 19th April 2011 Section No. :____C1801______

Declaration : I declare that this assignment is my individual work. I have not copied from any other student’s work or from any other source except where due acknowledgement is made explicitly in the text, nor has any part been written for me by another person.

Student’s Signature: MANISHA Evaluator’s comments : _________________________________________________________________________ __ Marks obtained :______________________ out of _________________________ Content of Homework should start from this page only: PART-A Question 1: Why there is a need of concurrency protocols when we have the serializability concept? Ans; - concurrency protocols are used to maintain database in a consistent state when multiple transaction executed at the same time. Lock-based protocol, timestamp protocol, validation protocol and multiple granularities are the concurrency control protocols. In a serializability concept, concurrency protocols play important role. When transactions are executed in serial manner, no transaction concurrency exists. However, if concurrent transactions with interleaving operations are allowed in an uncontrolled manner, then some undesirable result may occur that are follows as:-

In Thomas write rule. the read problem is occurred and incorrect result produced. Hence. execute the read operation . To avoid these problems we need concurrency protocols in serialibility concept. Thus. I agree with this statement “Thomas write rule modifies the timestamp ordering protocol”. Question 2: “Thomas write rule modifies the time-stamp ordering protocol”.transaction reads the data item from database and store into local variable in this phase. abort write operation and rollback T. .validation based protocol is the type of concurrency protocol. • If TS(T) ≥ W-Timestamp(A) then. updation problem is occurred. It process in three phases these are:• Read phase:.• • When the other transaction writes a second value of data on top of a first value that is written by a first concurrent transaction then the transactions that have read the wrong value end with incorrect results. hence transaction was abort read operation and T is rolled back. Thomas write rule is the modification of time. Why we term validation based protocol optimistic protocol? Explain the protocol with concurrent transactions? Ans:. T is trying to read a value of A that was already overwritten. Set R-Timestamp (A)=Max(R-Timestamp(A). Then following conditions are:• • • • If TS (T) < W-Timestamp (A) then. the transactions have same issues of read operation that are in time oriented protocol. Let us assume that transactions T issues write operation on data item (A). Then following conditions are :If TS(T) < W-Timestamp(A) then. Ans: . Let us assume that transactions T issues read operation on data item (A).TS(T)). write operation ignored.stamp ordering protocol which is further example of time stamp based protocol. While execute write operation and set the value of W-Timestamp(A) as TS(T) Question 3. If TS (T) < W-Timestamp (A) then. When transaction read a value that has been aborted later then this value removed from database and should not have read by any transaction.Yes. Do you agree? Justify your answer.

after the validation phase successfully completed. then all modified values are reflected to actual database and database can be updated with new values.let us assume that the railway reservation system is implemented using an RDBMS then we deal with concurrency control. validation phase comes and it checks whether any transaction’s updates are serializable or not. I will use log based recovery and shadow paging technique to recover the database if some failure occurred due to some logical errors. the transaction is aborted and then restarted again. Modifications are not done in this protocol. Concurrency control mechanism is used to . These records are stored in the log. If serializability is not violated.1) deferred log based recovery 2) immediate log based recovery.it performs some validation test to check whether the modified values can be copied into the actual database consistently or not. Justify your answer with techniques which you will use. otherwise. After this. Ans:YES.• Validation phase:. in order to avoid concurrency related problems in the above system? How can the deadlock be avoided in this system? Ans. Failure may cause data loss. Question 5: Assume that the Railway reservation system is implemented using an RDBMS. Recovery mechanism is useful to maintain the data in a consistent state when some failure occurred in transaction ad some system failure. What are the concurrency control measures one has to take. To avoid these problems we need recovery mechanism in database management system. All modifications are applied to local variables of the data items in the transaction during transaction execution phase. Two schemes are used in the log based recovery that are: . . • Write phase:. Log based recovery is used to maintain all records of the modification that are needed to be done in the databases. the transaction is committed and the database is updated from the local copies. Question 4: Do we need recovery in database management system. we need recovery system in database management system. Validation based protocol is also termed as optimistic protocol because optimistic concurrency protocol there are no checking is done while the transaction is executing.

Transaction is used to maintain the integrity of a database while running multiple concurrent operations. As paging scheme divides the logical memory into pages and physical memory into frames.Yes. then shadow page table is . atomicity. Deadlock occurred when each transaction is waiting for requested lock that is held by another transaction. there are three possible techniques applied these are :• • • Deadlock prevention Deadlock detection and recovery Time-out based scheme Question 6: “Shadow paging uses the concept of paging scheme (in operating system)”.Transaction is defined as a logical unit of work . Most locks used on Teradata resources that are automatically locked. • Locks. view and database. There can be several different types of resources that can be locked and several different ways of locking those resources. write.e. Transaction has ACID properties i.read. consistency. to handle the deadlock. Lock is a variable that are associated each data item which tell the status of any data item whenever any operations applied on it. Do you agree? Justify your answer. T h e Teradata resources RDBMS applies most of its locks. exclusive and access. It can be maintained by two mechanisms these are:• Transactions: .maintain the database in a consistent state when improper way of data is produced while insertion.1) current page table is to store the records of all database modification 2) shadow page table is used to restore the old values of data if some failure occurred in a transaction. Transactions are said to be serializable iff it produces the same desired result as some arbitrary serial execution of those same transactions for arbitrary input. after transaction commit. Ans:. B y d e f a u l t . The Teradata lock manager implicitly locks the following objects such that relation. integration and durability. shadow paging process is same but the difference is that it divides the database into pages and it treats the physical memory into frames. The mapping of database to physical memory is done by two page table:. There are four different levels of locking on this resource that are applied by user these are: . I agree with this statement that shadow paging uses the concept of paging. updation and deletion operation is applied.

This is the concept of shadow paging. .return to the pool of free blocks and all the modifications that are done in current page table is reflected to actual database.

Sign up to vote on this title
UsefulNot useful