Professional Documents
Culture Documents
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.
Evaluator’s comments :
_________________________________________________________________________
__
PART-A
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:-
• 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. Thus, updation
problem is occurred.
• When transaction read a value that has been aborted later then this value
removed from database and should not have read by any transaction. Hence,
the read problem is occurred and incorrect result produced.
Question 2: “Thomas write rule modifies the time-stamp ordering protocol”. Do you
agree? Justify your answer.
Ans: - Yes, I agree with this statement “Thomas write rule modifies the timestamp
ordering protocol”. Thomas write rule is the modification of time- stamp ordering protocol
which is further example of time stamp based protocol. In Thomas write rule, the
transactions have same issues of read operation that are in time oriented protocol.
Let us assume that transactions T issues read operation on data item (A). Then following
conditions are :-
• If TS(T) < W-Timestamp(A) then, T is trying to read a value of A that was already
overwritten, hence transaction was abort read operation and T is rolled back.
• If TS(T) ≥ W-Timestamp(A) then, execute the read operation .
Set R-Timestamp (A)=Max(R-Timestamp(A),TS(T)).
Let us assume that transactions T issues write operation on data item (A). Then following
conditions are:-
• If TS (T) < W-Timestamp (A) then, abort write operation and rollback T.
• If TS (T) < W-Timestamp (A) then, write operation ignored.
• While execute write operation and set the value of W-Timestamp(A) as TS(T)
Question 3. Why we term validation based protocol optimistic protocol? Explain the
protocol with concurrent transactions?
Ans:- validation based protocol is the type of concurrency protocol. It process in three
phases these are:-
• Read phase:- transaction reads the data item from database and store into
local variable in this phase.
• Validation phase:- it performs some validation test to check whether the
modified values can be copied into the actual database consistently or not.
• Write phase:- after the validation phase successfully completed, then all
modified values are reflected to actual database and database can be updated with
new values.
Ans; - let us assume that the railway reservation system is implemented using an RDBMS
then we deal with concurrency control. Concurrency control mechanism is used to
maintain the database in a consistent state when improper way of data is produced while
insertion, updation and deletion operation is applied. It can be maintained by two
mechanisms these are:-
• Locks. Lock is a variable that are associated each data item which tell the status of
any data item whenever any operations applied on it. There can be several different
types of resources that can be locked and several different ways of locking those
resources. Most locks used on Teradata resources that are automatically
locked. The Teradata lock manager implicitly locks the following objects
such that relation, view and database. There are four different levels of locking on
this resource that are applied by user these are: - read, write, exclusive and access.
B y d e f a u l t , T h e Teradata resources RDBMS applies most of its locks.
Deadlock occurred when each transaction is waiting for requested lock that is held by
another transaction. to handle the deadlock, there are three possible techniques applied
these are :-
• Deadlock prevention
Question 6: “Shadow paging uses the concept of paging scheme (in operating system)”.
Do you agree? Justify your answer.
Ans:- Yes, I agree with this statement that shadow paging uses the concept of paging. As
paging scheme divides the logical memory into pages and physical memory into frames,
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:- 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. after transaction commit, then shadow page table is
return to the pool of free blocks and all the modifications that are done in current page table
is reflected to actual database. This is the concept of shadow paging.