Professional Documents
Culture Documents
PART-A
• Strict Two phase locking protocol: This variation of two phase protocol is used to avoid
cascading rollbacks. In addition to two-phase locking, it requires that all the exclusive
mode locks acquired by a transaction must be held until that transaction commits.
• Rigorous two phase locking protocol: this protocol is further modification of strict two
phase locking. In addition to two phase locking, it requires that all the locks acquired by a
transaction must be held until that transaction commits.
• Two phase locking with lock conversion: this protocol adds the ability of lock
conversion to the basic two phase locking. It means that we can convert a shared lock to
an exclusive lock(called as upgrading) and an exclusive lock to a shared lock(called as
downgrading). The upgrade instruction is used to convert a shared lock to an exclusive
lock. The downgrade instruction is used to convert an exclusive lock to shared loc.
Upgrading is done in the growing phase whereas downgrading is done only in the
shrinking phase.
R-Timestamp (Q)=Max(R-Timestamp(Q),TS(T)).
Suppose that transaction T issues write(Q) operation the,
• If TS(T)<R-Timestamp(Q) then, abort write operation and rollback T.
PART-B
Ans::
What?
- Operation :
<Ti , start> : Before starts its execution, log record is written to the log.
<Ti , Xj , V2> : The write operation by Ti results in the writing of new record
to the log.
<Ti , commit> : When Ti partially commis, this record is written to the log.
Example
T1 : Read(A, a)
a = a - 100
Write(A, a)
Read(B, b)
b = b + 100
Write(B, b)
T2 : Read(C, c)
c = c - 200
Write(C, c)
• Redo(Ti)
(1) redo :
The log contains both the record <T1, start > and the record
What?
- Use undo :
• Undo(Ti)
Example
(1) Undo(Ti) :
If the log contains the record <Ti, start > but does not contain
needs to be undone.
(2) Redo(Ti) :
If the log contains both the record <Ti, start > and the record
Question 6: “Shadow paging uses the concept of paging scheme (in operating
system)”. Do you agree? Justify your answer.
Ans::
Shadow paging uses the concept of paging scheme. As we know that paging scheme is used in
operating system for virtual memory management
Paging scheme divides the physical memory into a number of fixed-size blocks called as frames
and it divides the logical memory into a number of fixed-size blocks called as pages. The frame
size is same as that of page size. The logical pages are mapped with the help of page table.
Shadow paging divides database into a number of fixed-size blocks called as pages and it also
treats the physical memory to be composed of a number of fixed-size blocks called as frames.
The database pages are mapped into physical frames with the help of two page tables and they
are:
• Current page table