Showing posts with label Database Quizzes. Show all posts
Showing posts with label Database Quizzes. Show all posts

Saturday, December 4, 2021

DBMS MCQ - Which is a non-recoverable schedule

Multiple choices questions in DBMS, Which is non-recoverable schedule? How do we find whether a schedule is recoverable or not? Can we permit a transaction that has used a data item written by another uncommitted transaction?

DBMS MCQ - Non-recoverable schedules

< Previous                      

Next >

 

1. In a schedule S with two transactions T1 and T2, T1 reads the data item which was produced by T2 and T1 commits before T2 commits. In this case, the schedule S is said to be a _________ schedule.

a) recoverable

b) non-recoverable

c) conflict serializable

d) serial

Answer: (b) non-recoverable

The given case is a non-recoverable schedule. Let us suppose that the transaction T2 decided to rollback after T1 commits. In this case, the value of the data item consumed by T1 was wrong. We have to rollback T1 which cannot be done because T1 has committed. As per the durability property, the rollback is not permitted for a committed transaction.

How to avoid non-recoverable schedules?

To avoid such a situation, we can postpone the commit of T1 until T2 commits.

Recoverable schedule.

Let us consider a schedule with two transactions T1 and T2. In this schedule, if the transaction T2 reads the value of data item x which was produced by T1, then the commit of T1 must happen before that of T2. Such a schedule is recoverable schedule.


 

< Previous                      

Next >


************************
Related posts:


What is non-recoverable schedule?

How do we find whether a schedule is recoverable or not?

Can we permit a transaction that has read the data item which was written by an uncommitted transaction?

Why a committed transaction cannot be rolled back?

Concurrency control in DBMS

Thursday, December 2, 2021

DBMS MCQ - Timestamp ordering protocol is free from deadlock - Why

Multiple choices questions in DBMS, Is timestamp ordering protocol free from deadlock? Why do we say that the timestamp ordering protocol is free from deadlock? Concurrency control in DBMS

DBMS MCQ - Timestamp ordering protocol

< Previous                      

Next >

 

1. Timestamp ordering protocol is said to be free from deadlock because of this reason.

a) It is cascade free

b) It guarantees serializability

c) No transaction is made to wait

d) Every write operation updates the W-timestamp of the data item

Answer: (c) No transaction is made to wait

In timestamp ordering protocol, a transaction is either permitted to execute the operation or rolled back. No transaction is made to wait for some other transaction. A transaction is permitted to execute in all the following cases and rolled back otherwise;

A transaction T that tries to execute read(Q) operation will be permitted if and only if the timestamp(T) >= W-timestamp(Q). That is, T is permitted to execute if it is started after a successful write on Q by some transactions.

A transaction T that tries to execute write(Q) operation will be permitted if the timestamp(T) is greater than both the R-timestamp(Q) and W-timestamp(Q). That is, T is permitted to write a data item which was read/write by older transactions.

 

< Previous                      

Next >


************************
Related posts:


Concurrency control in dbms

Quiz questions with answers on DBMS concepts

Why do we say that the timestamp ordering protocol is free from deadlock?

No transactions are made to wait in timestamp ordering protocol. How is this achieved?

How does timestamp ordering protocol work?

Schedules under timestamp ordering protocol are deadlock free

Can deadlock happen in schedules that uses timestamp ordering protocol?

Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents

data recovery