0% found this document useful (0 votes)
21 views50 pages

DBMS UNIT 5 Part 1

Uploaded by

msreevanicse
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views50 pages

DBMS UNIT 5 Part 1

Uploaded by

msreevanicse
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Unit – 6

Transaction
Management
Prof. Firoz Sherasiya
9879879861
[email protected]
Database Management System (2130703) Darshan Institute of Engineering & Technology
What is transaction?
 A transaction is a sequence of operations performed as a single
logical unit of work.
 A transaction is a logical unit of work that contains one or more
SQL statements.
Works as a single
 Example of transaction logical unit
read (A)
A = A – 50
Transaction write (A)
Operations
read (B)
B = B + 50
write (B)

Unit – 6: Transaction Management 2 Darshan Institute of Engineering & Technology


ACID properties of transaction
 To preserve the integrity of data the database system must ensure:
 Atomicity: Either all operations of the transaction are properly
reflected in the database or none are.
 Consistency: Execution of a transaction in isolation preserves the
consistency of the database.
 Isolation: Although multiple transactions may execute concurrently,
each transaction must be unaware of other concurrently executing
transactions. Intermediate transaction results must be hidden from
other concurrently executed transactions.
 □ That is, for every pair of transactions Ti and Tj, it appears to Ti that
either Tj, finished execution before Ti started, or Tj started execution
after Ti finished.
 Durability: After a transaction completes successfully, the changes it
has made to the database persist, even if there are system failures.
Unit – 6: Transaction Management 3 Darshan Institute of Engineering & Technology
ACID properties of transaction
• Atomicity 0%
 This property states that a transaction read (A)
must be treated as an atomic unit, that
is, either all of its operations are
A = A – 50
executed or none. write (A)
FAIL
 Either transaction execute 0% or 100%. read (B)
 For example, consider a transaction to B = B + 50
transfer Rs. 50 from account A to
account B. write (B)
100%
 In this transaction, if Rs. 50 is deducted
from account A then it must be added to
account B.

Unit – 6: Transaction Management 4 Darshan Institute of Engineering & Technology


ACID properties of transaction
• Consistency A=500, B=500
 The database must remain in a A+B=1000
consistent state after any transaction.
read (A)
 If the database was in a consistent state
before the execution of a transaction, it A = A – 50
must remain consistent after the write (A)
execution of the transaction as well.
read (B)
 In our example, total of A and B must
remain same before and after the B = B + 50
execution of transaction. write (B)
A=450, B=550
A+B=1000

Unit – 6: Transaction Management 5 Darshan Institute of Engineering & Technology


ACID properties of transaction
• Isolation read (A)
 Changes occurring in a particular A = A – 50
transaction will not be visible to any
other transaction until it has been
write (A)
committed. read (B)
 Intermediate transaction results must B = B + 50
be hidden from other concurrently
executed transactions.
write (B)
 In our example once our transaction
starts from first step (step 1) its result
should not be access by any other
transaction until last step (step 6) is
completed.

Unit – 6: Transaction Management 6 Darshan Institute of Engineering & Technology


ACID properties of transaction
• Durability A=500, B=500
 After a transaction completes read (A)
successfully, the changes it has made to
the database persist (permanent), even
A = A – 50
if there are system failures. write (A)
 Once our transaction completed up to read (B)
last step (step 6) its result must be
stored permanently. It should not be
B = B + 50
removed if system fails. write (B)
A=450, B=550

Unit – 6: Transaction Management 7 Darshan Institute of Engineering & Technology


Example of Fund Transfer
16 (Cont.)
 Transaction to transfer $50 from account A to account B:
1. read(A)
2. A := A – 50
3. write(A)
4. read(B)
5. B := B + 50
6. write(B)
 Consistency requirement in above example:
□ The sum of A and B is unchanged by the execution of the transaction

 In general, consistency requirements include


□ A transaction must see a consistent database.
□ During transaction execution the database may be temporarily
inconsistent.
□ When the transaction completes successfully the database
must be consistent

Unit – 6: Transaction Management 8 Darshan Institute of Engineering & Technology


Example of Fund Transfer
17 (Cont.)
 Isolation requirement: If between steps 3 and 6, another transaction
T2 is allowed to access the partially updated database, it will see an
inconsistent database (the sum A + B will be less than it should
be).
T1 T2
1. read(A)
2. A := A –
50
3. write(A) read(A), read(B), print(A+B)
4. read(B)
5. B := B + 50
6. write(B
 Isolation can be ensured by running transactions serially
□ that is, one after the other.

 However, executing multiple transactions concurrently has significant


benefits
******END******
Unit – 6: Transaction Management 9 Darshan Institute of Engineering & Technology
Storage Structure
 Storage structure is also known as the memory structure. In
DBMS, memory structure is broadly divided into:
 Volatile Memory
These are primary memory devices which are placed along with CPU. Capable of storing
only a small amount of data, but are fastest in comparison to all other memory.
However, these primary devices cannot endure system crashes and in case of failure,
data will be lost completely. Example: Cache memory
 Non-Volatile Memory
Non-Volatile Memory is also known as Secondary Memory. They are huge in size but
slow in speed. They are capable of surviving system crashes. However, they can still fail
and lose data.
Stable Memory
The concept of stable memory is almost the same as Non-volatile memory. However, it is
a mythical form of memory in which copies of data are made available. So, in case of
crash/failure, data can still be recovered.
*******END*****

Unit – 6: Transaction Management 10 Darshan Institute of Engineering & Technology


Transaction Atomicity & Durability
 Atomicity deals with these failures:
• User aborts transaction (e.g., cancel button)
• System may crash (e.g., because the power supply is interrupted)
• System aborts transaction (e.g., deadlock)
• Transaction aborts itself (e.g., unexpected db state)
 Durability deals with this type of failure:
• Media failure
 The mechanism for dealing with all of these failures is the log (a
built in system file to the dbms)

Unit – 6: Transaction Management 11 Darshan Institute of Engineering & Technology


Transaction State Diagram \ State Transition Diagram
• The
Whentransaction enters
a transaction in this its
executes state after
final successful
operation, it is said
completion of the transaction.
to be in a partially committed state.
• We cannot abort or rollback a committed transaction.
read (A)
Partial
Committed Committed
A = A – 50
write (A)
Active End read (B)
B = B + 50
Failed Aborted
write (B)
Commit
• •TheThis
Discover
stateisthat
the
afterinitial
normal state.
executionhas
the transaction canbeen
no longer
rolledproceed.
back and
• •Once
theThe a transaction
transaction
database stays
cannot
has been in be
thiscompleted,
restored state
to its stateany changes
prior to the
thatwhile
start it istransaction.
itofmade
the executing.
must be undone rolling it back.

Unit – 6: Transaction Management 12 Darshan Institute of Engineering & Technology


Transaction State Diagram \ State Transition Diagram

 Active
• This is the initial state.
• The transaction stays in this state while it is executing.
 Partial Committed
• When a transaction executes its final operation/ instruction, it is said to be in a
partially committed state.
 Failed
• Discover that normal execution can no longer proceed.
• Once a transaction cannot be completed, any changes that it made must be
undone rolling it back.

Unit – 6: Transaction Management 13 Darshan Institute of Engineering & Technology


Transaction State Diagram \ State Transition Diagram
 Committed
• The transaction enters in this state after successful completion of the
transaction (after committing transaction).
• We cannot abort or rollback a committed transaction.
 Aborted
 After the transaction has been rolled back and the database

restored to its state prior to the start of the transaction. Two options
after it has been aborted:
□ restart the transaction

□ kill the transaction

Unit – 6: Transaction Management 14 Darshan Institute of Engineering & Technology


 Log: An append-only sequence of records used to restore database to a
consistent state after a failure. Stored on non-volatile device physically separate
from the mass storage device that contains database. Needs to survives
processor crash and media failure
 For each transaction:
• Each transaction is tagged with a Begin Transaction Record
 Update record is logged:
• Applied to all updates -- insert, delete, update SQL operations
• Appended to log when a transaction updates an item
• Contains a before image: value of item prior to update
• Before image is used to restore item when transaction is aborted
• Read operations are not necessarily logged
• Commit:
 Commit record is logged and indicates the end of the successful transaction
 Abort a Transaction
• Abort record is logged.
• Scan log backward; apply each "before image" data in each of the transaction’s update
records to database items to restore them to their original state.
• Encountering a Begin Transaction Record terminates scan
******************end ****************

Unit – 6: Transaction Management 15 Darshan Institute of Engineering & Technology


Transaction Isolation and levels
 The Transaction Manager should guarantee that concurrently executing
transactions do not interfere with each other
 If this is not the case, 4 basic types of problems could arise:
• Lost Update: concurrent updates
• Dirty Read: reading uncommitted data
• Unrepeatable Read: interleaving reads and writes
• Phantom Row: new data not appearing in the result of a query

Unit – 6: Transaction Management 16 Darshan Institute of Engineering & Technology


 Isolation levels represent the database system’s ability to prevent these
behaviors. The American National Standards Institute (ANSI) defines four
isolation levels:
• Read uncommitted (0)
• Read committed (1)
• Repeatable read (2)
• Serializable (3)
 In ascending order (0–3), these isolation levels provide an increasing amount of
data consistency to the transaction. At the lowest level, all three behaviors can
occur. At the highest level, none can occur. The success of each level in
preventing these behaviors is due to the locking strategies they use, which are
as follows:

Unit – 6: Transaction Management 17 Darshan Institute of Engineering & Technology


Unit – 6: Transaction Management 18 Darshan Institute of Engineering & Technology
What is schedule?
 A schedule is a process of grouping the transactions into one and
executing them in a predefined order.
 A schedule is the chronological (sequential) order in which
instructions are executed in a system.
 A schedule is required in a database because when some
transactions execute in parallel, they may affect the result of the
transaction.
 Means if one transaction is updating the values which the other
transaction is accessing, then the order of these two transactions
will change the result of another transaction.
 Hence a schedule is created to execute the transactions.

Unit – 6: Transaction Management 19 Darshan Institute of Engineering & Technology


Example of schedule
T1 T2 A=B=1000
Read (A) Read (1000)
A = A - 50 A = 1000 - 50
Write (A) Write (950)
Read (B) Read (1000)
B = B + 50 B = 1000 + 50
Write (B) Write (1050)
Commit Commit
Read (A) Read (950)
temp = A * 0.1 temp = 950 * 0.1
A = A - temp A = 950 - 95
Write (A) Write (855)
Read (B) Read (1050)
B = B + temp B = 1050 + 95
Write (B) Write (1145)
Commit Commit

Unit – 6: Transaction Management 20 Darshan Institute of Engineering & Technology


Example of schedule
T1 T2 A=B=1000
Read (A) Read (1000)
Temp = A * 0.1 Temp = 1000 * 0.1
A = A - temp A = 1000 - 100
Write (A) Write (900)
Read (B) Read (1000)
B = B + temp B = 1000 + 100
Write (B) Write (1100)
Commit Commit
Read (A) Read (900)
A = A - 50 A = 900 - 50
Write (A) Write (850)
Read (B) Read (1100)
B = B + 50 B = 1100 + 50
Write (B) Write (1150)
Commit Commit

Unit – 6: Transaction Management 21 Darshan Institute of Engineering & Technology


Serial schedule
 A serial schedule is one in which no transaction starts until a
running transaction has ended.
 Transactions are executed one after the other.
 This type of schedule is called a serial schedule, as transactions
are executed in a serial manner.

Unit – 6: Transaction Management 22 Darshan Institute of Engineering & Technology


Example of serial schedule
T1 T2
Read (A)
Temp = A * 0.1
A = A - temp
Write (A)
Read (B)
B = B + temp
Write (B)
Commit
Read (A)
A = A - 50
Write (A)
Read (B)
B = B + 50
Write (B)
Commit

Unit – 6: Transaction Management 23 Darshan Institute of Engineering & Technology


Example of serial schedule
T1 T2
Read (A)
A = A - 50
Write (A)
Read (B)
B = B + 50
Write (B)
Commit
Read (A)
Temp = A * 0.1
A = A - temp
Write (A)
Read (B)
B = B + temp
Write (B)
Commit

Unit – 6: Transaction Management 24 Darshan Institute of Engineering & Technology


Interleaved schedule
 Schedule that interleave the execution of different transactions.
 Means second transaction is started before the first one could
end and execution can switch between the transactions back and
forth.

Unit – 6: Transaction Management 25 Darshan Institute of Engineering & Technology


Example of interleaved schedule
T1 T2
Read (A)
Temp = A * 0.1
A = A - temp
Read (B) Write (A)
B = B + temp
Write (B)
Commit

Read (A)
A = A - 50
Write (A)
Read (B)
B = B + 50
Write (B)
Commit

Unit – 6: Transaction Management 26 Darshan Institute of Engineering & Technology


Example of interleaved schedule
T1 T2
Read (A)
A = A - 50
Write (A)
Read (B)
B = B + 50
Write (B)
Commit
Read (A)
Temp = A * 0.1
A = A - temp
Write (A)
Read (B)
B = B + temp
Write (B)
Commit

Unit – 6: Transaction Management 27 Darshan Institute of Engineering & Technology


Equivalent schedule
 If two schedules produce the same result after execution, they
are said to be equivalent schedule.
 They may yield the same result for some value and different
results for another set of values.
 That's why this equivalence is not generally considered significant.

Unit – 6: Transaction Management 28 Darshan Institute of Engineering & Technology


Equivalent schedule
T1 T2 T1 T2

Both schedules are equivalent


Read (A) Read (A)

In both schedules the sum “A + B” is preserved.


A = A - 50 A = A - 50
Write (A) Write (A)
Commit Read (A) Read (B)
Temp = A * 0.1 B = B + 50
A = A - temp Write (B)
Write (A) Commit
Commit Read (A)
Read (B) Temp = A * 0.1
B = B + 50 A = A - temp
Write (B) Write (A)
Commit Read (B) Read (B)
B = B + temp B = B + temp
Write (B) Write (B)
Commit Commit

Unit – 6: Transaction Management 29 Darshan Institute of Engineering & Technology


Serializability
 A schedule is serializable if it is equivalent to a serial schedule.
 In serial schedules, only one transaction is allowed to execute at
a time i.e. no concurrency is allowed.
 Whereas in serializable schedules, multiple transactions can
execute simultaneously i.e. concurrency is allowed.
 Types (forms) of serializability
1. Conflict serializability
2. View serializability

Unit – 6: Transaction Management 30 Darshan Institute of Engineering & Technology


Conflicting instructions
 Let li and lj be two instructions of transactions Ti and Tj
respectively.
T1 T2 T1 T2
1. li = read(Q), lj = read(Q)
read (Q) read (Q)
li and lj don’t conflict read (Q) read (Q)

2. li = read(Q), lj = write(Q) T1 T2 T1 T2
read (Q) write(Q)
li and lj conflict
write(Q) read (Q)
3. li = write(Q), lj = read(Q) T1 T2 T1 T2
li and lj conflict write(Q) read (Q)
read (Q) write(Q)
4. li = write(Q), lj = write(Q)
T1 T2 T1 T2
li and lj conflict write(Q) write(Q)
write(Q) write(Q)
Unit – 6: Transaction Management 31 Darshan Institute of Engineering & Technology
Conflicting instructions
 Instructions li and lj conflict if and only if there exists some item Q
accessed by both li and lj, and at least one of these instructions
wrote Q.
 If both the transactions access different data item then they are
not conflict.

Unit – 6: Transaction Management 32 Darshan Institute of Engineering & Technology


Conflict serializability
 If a given schedule can be converted into a serial schedule by
swapping its non-conflicting operations, then it is called as a
conflict serializable schedule.

Unit – 6: Transaction Management 33 Darshan Institute of Engineering & Technology


Conflict serializability (example)
T1 T2 T1 T2
Read (A) Read (A)
A = A - 50 A = A - 50
Write (A) Write (A)
Read (A) Read (B)
Temp = A * 0.1 B = B + 50
A = A - temp Write (B)
Write (A) Commit
Read (A)
Read (B) Temp = A * 0.1
B = B + 50 A = A - temp
Write (B) Write (A)
Commit Read (B) Read (B)
B = B + temp B = B + temp
Write (B) Write (B)
Commit Commit

Unit – 6: Transaction Management 34 Darshan Institute of Engineering & Technology


Conflict serializability
 Example of a schedule that is not conflict serializable:
T1 T2
Read (A)
Write (A)
Read (A)

 We are unable to swap instructions in the above schedule to


obtain either the serial schedule < T1, T2 >, or the serial schedule
< T2, T1 >.

Unit – 6: Transaction Management 35 Darshan Institute of Engineering & Technology


View serializability
 Let S1 and S2 be two schedules with the same set of transactions.
S1 and S2 are view equivalent if the following three conditions
are satisfied, for each data item Q
1. Initial Read
2. Updated Read
3. Final Write

Unit – 6: Transaction Management 36 Darshan Institute of Engineering & Technology


Initial Read
 If in schedule S1, transaction Ti reads the initial value of Q, then
in schedule S2 also transaction Ti must read the initial value of
Q.
S1 S3 S2
T1 T2 T1 T2 T1 T2
Read (A) Read (A) Write (A)
Write (A) Write (A) Read (A)

 Above two schedules S1 and S3 are not view equivalent because


initial read operation in S1 is done by T1 and in S3 it is done by T2.
 Above two schedules S1 and S2 are view equivalent because initial
read operation in S1 is done by T1 and in S2 it is also done by T1.

Unit – 6: Transaction Management 37 Darshan Institute of Engineering & Technology


Updated Read
 If in schedule S1 transaction Ti executes read(Q), and that value
was produced by transaction Tj (if any), then in schedule S2 also
transaction Ti must read the value of Q that was produced by
transaction Tj.
S1 S3
T1 T2 T3 T1 T2 T3
Write (A) Write (A)
Write (A) Write (A)
Read (A) Read (A)

 Above two schedules are not view equal because, in S1, T3 is


reading A that is updated by T2 and in S3, T3 is reading A which is
updated by T1.

Unit – 6: Transaction Management 38 Darshan Institute of Engineering & Technology


Updated Read
 If in schedule S1 transaction Ti executes read(Q), and that value
was produced by transaction Tj (if any), then in schedule S2 also
transaction Ti must read the value of Q that was produced by the
same write(Q) operation of transaction Tj.
S1 S2
T1 T2 T3 T1 T2 T3
Read (A) Read (A)
Write (A) Write (A)
Write (A) Read (A)
Read (A) Write (A)

 Above two schedules are view equal because, in S1, T3 is reading


A that is updated by T2 and in S3 also, T3 is reading A which is
updated by T2.

Unit – 6: Transaction Management 39 Darshan Institute of Engineering & Technology


Final Write
 If Ti performs the final write on the data value in S1, then it also
performs the final write on the data value in S2.

S1 S2
T1 T2 T3 T1 T2 T3
Write (A) Read (A)
Read (A) Write (A)
Write (A) Write (A)

 Above two schedules is view equal because final write operation


in S1 is done by T3 and in S2 also the final write operation is also
done by T3.

Unit – 6: Transaction Management 40 Darshan Institute of Engineering & Technology


Two phase commit protocol
 Two phase commit protocol ensures that all participants perform
the same action (either to commit or to rollback a transaction).
 It is designed to ensure that either all the databases are updated
or none of them, so that the databases remain synchronized.
 In two phase commit protocol there is one node which is act as a
coordinator or controlling site and all other participating node are
known as cohorts or participant or slave.
 Coordinator (controlling site) – the component that coordinates
with all the participants.
 Cohorts (Participants/Slaves) – each individual node except
coordinator are participant.

Unit – 6: Transaction Management 41 Darshan Institute of Engineering & Technology


Two phase commit protocol
 As the name suggests, the two phase commit protocol involves
two phases.
1. Commit request phase OR Prepare phase
2. Commit/Abort phase

Unit – 6: Transaction Management 42 Darshan Institute of Engineering & Technology


Two phase commit protocol

Prepare
Phase

Commit
Phase
Coordinator
Coordinator
Participant
Send toinform
send
“ack” send to do
reply
inform
commit
request asking
whether ready for
commit readyor
todone
to commit
commit
not or not

Unit – 6: Transaction Management 43 Darshan Institute of Engineering & Technology


Two phase commit protocol
1. Commit Request Phase (Obtaining Decision)
• After each slave has locally completed its transaction, it sends a “DONE”
message to the controlling site.
• When the controlling site has received “DONE” message from all slaves, it
sends a “Prepare” (prepare to commit) message to the slaves.
• The slaves vote on whether they still want to commit or not.
• If a slave wants to commit, it sends a “Ready” message.
• A slave that does not want to commit sends a “Not Ready” message.
• This may happen when the slave has conflicting concurrent transactions or
there is a timeout.

Unit – 6: Transaction Management 44 Darshan Institute of Engineering & Technology


Two phase commit protocol
2. Commit Phase (Performing Decision)
1) After the controlling site has received “Ready” message from all the
slaves:
• The controlling site sends a “Global Commit” message to the slaves.
• The slaves commit the transaction and send a “Commit ACK” message to
the controlling site.
• When the controlling site receives “Commit ACK” message from all the
slaves, it considers the transaction as committed.

Unit – 6: Transaction Management 45 Darshan Institute of Engineering & Technology


Two phase commit protocol
2. Commit Phase (Performing Decision)
2) After the controlling site has received the first “Not Ready” message
from any slave:
• The controlling site sends a “Global Abort” message to the slaves.
• The slaves abort the transaction and send a “Abort ACK” message to the
controlling site.
• When the controlling site receives “Abort ACK” message from all the
slaves, it considers the transaction as aborted.

Unit – 6: Transaction Management 46 Darshan Institute of Engineering & Technology


Transaction Definition in SQL
49

 Data manipulation language must include a construct


for specifying the set of actions that comprise a
transaction.
 In SQL, a transaction begins implicitly.
 A transaction in SQL ends by:
□ Commit work commits current transaction and begins a
new one.
□ Rollback work causes current transaction to abort.

 In almost all database systems, by default, every SQL


statement also commits implicitly if it executes successfully
□ Implicit commit can be turned off by a database directive

 E.g. in JDBC, connection.setAutoCommit(false);

Unit – 6: Transaction Management 47 Darshan Institute of Engineering & Technology


 The following commands are used to control transactions.
• COMMIT − to save the changes.
• ROLLBACK − to roll back the changes.
• SAVEPOINT − creates points within the groups of transactions in which to ROLLBACK.
• SET TRANSACTION − Places a name on a transaction.
The COMMIT Command
 The COMMIT command is the transactional command used to save changes invoked by a
transaction to the database.
 The COMMIT command is the transactional command used to save changes invoked by a
transaction to the database. The COMMIT command saves all the transactions to the
database since the last COMMIT or ROLLBACK command.
 The syntax for the COMMIT command is as follows.
COMMIT;
The ROLLBACK Command
 The ROLLBACK command is the transactional command used to undo transactions
that have not already been saved to the database. This command can only be used
to undo transactions since the last COMMIT or ROLLBACK command was issued.
 The syntax for a ROLLBACK command is as follows −
ROLLBACK;

Unit – 6: Transaction Management 48 Darshan Institute of Engineering & Technology


The SAVEPOINT Command
 A SAVEPOINT is a point in a transaction when you can roll the transaction back to a certain
point without rolling back the entire transaction.
 The syntax for a SAVEPOINT command is as shown below.
SAVEPOINT SAVEPOINT_NAME;
 This command serves only in the creation of a SAVEPOINT among all the transactional
statements. The ROLLBACK command is used to undo a group of transactions.
 The syntax for rolling back to a SAVEPOINT is as shown below.
ROLLBACK TO SAVEPOINT_NAME;
 he RELEASE SAVEPOINT Command
 The RELEASE SAVEPOINT command is used to remove a SAVEPOINT that you have created.
 The syntax for a RELEASE SAVEPOINT command is as follows.
 RELEASE SAVEPOINT SAVEPOINT_NAME; Once a SAVEPOINT has been released, you can no
longer use the ROLLBACK command to undo transactions performed since the last
SAVEPOINT.
The SET TRANSACTION Command
 The SET TRANSACTION command can be used to initiate a database transaction. This
command is used to specify characteristics for the transaction that follows. For example, you
can specify a transaction to be read only or read write.
 The syntax for a SET TRANSACTION command is as follows.
SET TRANSACTION [ READ WRITE | READ ONLY ];

Unit – 6: Transaction Management 49 Darshan Institute of Engineering & Technology


Questions asked in GTU
1. Write a note on two phase locking protocol.
2. Explain ACID properties of transaction with suitable example.
3. What is log based recovery? Explain immediate database modification
technique for database recovery. OR Define Failure. Write a note on log
based recovery.
4. State differences between conflict serializability and view serializability.
5. Explain two-phase commit protocol.
6. Define transaction. Explain various states of transaction with suitable
diagram.
7. Write differences between shared lock and exclusive lock.
8. Explain deadlock with suitable example.
9. What is locking? Define each types of locking.
10. Define wait-Die & wound-wait.

Unit – 6: Transaction Management 50 Darshan Institute of Engineering & Technology

You might also like