0% found this document useful (0 votes)
220 views

CSE200 HW4 Dbms

This document contains questions and answers related to a database management course. PART 1 includes questions about conflict serializability, conflicting vs non-conflicting transactions, and the difference between conflict serializability and conflict equivalence. PART 2 compares and contrasts database transaction concepts like commit vs rollback, immediate vs deferred update, and provides examples to justify why undo recovery is performed backwards and redo recovery is performed forwards.

Uploaded by

Raj Shah
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
220 views

CSE200 HW4 Dbms

This document contains questions and answers related to a database management course. PART 1 includes questions about conflict serializability, conflicting vs non-conflicting transactions, and the difference between conflict serializability and conflict equivalence. PART 2 compares and contrasts database transaction concepts like commit vs rollback, immediate vs deferred update, and provides examples to justify why undo recovery is performed backwards and redo recovery is performed forwards.

Uploaded by

Raj Shah
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

HOMEWORK -4

COURSE CODE: CSE200

COURSE NAME: Managing Database

PART-1

Q1.Explain the concept of Conflict Serializibility. Define Conflicting Instructions and


Non-Conflicting Instructions.

Ans : serializibility :a schedule that produces the same results as a


serial schedule. when concurrent transactions take place then the
schedule no longer remains a serial one. so to check whether the
transcations are excuted properly without any update loss we need
this concept.

conflict serializibility: a schedule is conflict serializibable if it is


conflict equivalent to a serial schedule.

(conflict equivalent : a schedule s when transformed into a schedule


s' by a series of swaps of nonconflicting transactions then we say that s
ans s' are conflict equivalent.)

can anyone help me in bringing out the difference?

(PDF file)

Q2.Define a Cascade-less schedule and a Recoverable Schedule. If a schedule is not


Cascade-less, does it mean “no recovery is feasible”? Justify your answer.

( there is other file in folder) name csecadless……….. and also ppt

Q3.Using a suitable example justify how strict two phase locking can lead to deadlock?

Ans :
Do with ppt and pdf file……in this folder………..
PART-2

Q4.Compare and Contrast the following:

Make by raj 9464554250


(i) Commit and Roll-Back

Ans :

Rollback:

This is used for undoing the work done in the current transaction. This command also
releases the locks if any hold by the current transaction. The command used in SQL for this
is simply:

ROLLBACK;

Savepoint:

This is used for identifying a point in the transaction to which a programmer can later roll
back. That is it is possible for the programmer to divide a big transaction into subsections
each having a savepoint defined in it. The command used in SQL for this is simply:

SAVEPOINT savepointname;

For example:

UPDATE…..
DELETE….
SAVEPOINT e1;
INSERT….
UPDATE….
SAVEPOINT e2;
……

It is also possible to define savepoint and rollback together so that programmer can achieve
rollback of part o a transaction. Say for instance in the above

ROLLBACK TO SAVEPOINT e2;

This results in the rollback of all statements after savepoint e2

Commit:

This is used to end the transaction and make the changes permanent. When commit is
performed all save points are erased and transaction locks are released. In other words
commit ends a transaction and marks the beginning of a new transaction. The command
used in SQL for this is simply:

COMMIT;

Or

COMMIT - save work done ROLLBACK - restore database


to original since the last COMMIT

COMMIT - to commit the sql operations done so far.

Make by raj 9464554250


ROLEBACK - to revoke the SQL operation done so far

(ii) Immediate Update and Deferred Update

Ans :

Whether the consumer uses immediate or deferred update mode depends on how many
consumers share the rowset and how they use the rowset. In most cases, the primary user of
immediate update mode is a single consumer that wants to transmit changes immediately to the
data store. Consumers use deferred update mode for many reasons, including the following:

• Shared rowsets — If multiple consumers share a rowset, they often use notifications to
coordinate multiple changes. By using deferred update mode, consumers can coordinate
their changes locally in the rowset before transmitting them to the data store.
• Multiple changes to the same row — If a consumer makes multiple changes to the same
row, such as when multiple accessors are used or when users input changes at different
times, the row might be left in an invalid state. For example, if a key consists of several
columns and each column is changed in a separate call to IRowsetChange::SetData, the
intermediate states might be invalid. By using deferred update mode, the consumer can
buffer these changes in the rowset before transmitting them to the data store.
• Network traffic — If a rowset resides on one node in a network and the data store
resides on another node, transmitting changes from the rowset to the data store requires a
network call. By using deferred update mode, the consumer can batch changes to
multiple rows and send them across the network with a single call to
IRowsetUpdate::Update. This is particularly critical for wide area networks such as the
Internet, on which network calls are very expensive.
• Undoing changes — IRowsetUpdate::Undo enables the consumer to undo pending
changes. By using deferred update mode, consumers can expose an undo capability to
users without having to implement it.

OR

 Immediate update approach:

 Before commit

 Log records written first (w rite-ahead log protocol)

 Deferred update approach

 After commit

 Undo operations not needed

Make by raj 9464554250


Q5.Consider a case of Computer related fraud you are familiar with. List the security
and Integrity constraints should have been implemented.Could audit and Control
Procedure have prevented the fraud?

Ans :

See anwer in pdf file s ans other files in folder………….

Q6.Using an example Justify why the Undo Pass of recovery procedure is Performed in
the backward direction and Redo Pass is performed in the forward direction?

………..Ans : see answer in pdf file in folder

Make by raj 9464554250

You might also like