Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CMPT 454 Quiz 9 - ACID Transactions, Schedules and P2L Exam, Exams of Advanced Education

A comprehensive overview of acid properties in database transactions, including definitions, explanations, and examples. It delves into concepts like transaction schedules, conflicts, and locking mechanisms, particularly focusing on two-phase locking (2pl) and its variations. The document also explores the role of the scheduler and lock manager in ensuring database consistency and durability. It is a valuable resource for students studying database management and transaction processing.

Typology: Exams

2024/2025

Available from 02/14/2025

lyudmila-hanae
lyudmila-hanae 🇺🇸

1

(2)

7.8K documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CMPT 454 Quiz 9 - ACID Transactions, Schedules and P2L Exam
T or F: A single transaction may result in multiple actions - Answer True
Transactions should have the ACID properties. What are they? - Answer 1. Atomic -
either all or none of a transaction's actions are carried out
2. Consistent - transaction must preserve the DB consistency
3. Isolated - transaction should make sense in isolation, should stand on their own and
should be protected from the effects of other concurrently executing transactions
4. Durable - once a transaction is completed, its effects should persist even in the event
of a system crash
How can a DB remain consistent? - Answer If transactions are:
- consistent
- processed as if they occur in some serial order
- atomic, no partial transactions occur
What does it mean for a DB to be in a consistent state? - Answer - Satisfies the
constraints of the DB schema
- Transactions leave the DB in a consistent state
- Transactions are executed serially
Where are transactions processed? - Answer Main memory
How can we achieve durability of transactions? - Answer Maintain backups of the
database
What is the scheduler? Where does it take place? - Answer The process responsible for
pf3
pf4

Partial preview of the text

Download CMPT 454 Quiz 9 - ACID Transactions, Schedules and P2L Exam and more Exams Advanced Education in PDF only on Docsity!

CMPT 454 Quiz 9 - ACID Transactions, Schedules and P2L Exam T or F: A single transaction may result in multiple actions - Answer True Transactions should have the ACID properties. What are they? - Answer 1. Atomic -either all or none of a transaction's actions are carried out

  1. Consistent - transaction must preserve the DB consistency
  2. Isolated - transaction should make sense in isolation, should stand on their own andshould be protected from the effects of other concurrently executing transactions
  3. Durable - once a transaction is completed, its effects should persist even in the eventof a system crash

How can a DB remain consistent? - Answer If transactions are:

  • consistent- processed as if they occur in some serial order
  • atomic, no partial transactions occur What does it mean for a DB to be in a consistent state? - Answer - Satisfies theconstraints of the DB schema
  • Transactions leave the DB in a consistent state
  • Transactions are executed serially Where are transactions processed? - Answer Main memory How can we achieve durability of transactions? - Answer Maintain backups of thedatabase

What is the scheduler? Where does it take place? - Answer The process responsible for

executing reads & writes. It takes place in the main memory, not the disk. What are the two possible last actions of a transaction? - Answer Commit or abort What must happen if a transaction is aborted? - Answer All of its actions must be undone What is the difference between a complete schedule and a serial schedule? - Answer Acomplete schedule is one that contains either an abort or commit action for each of its transactions A serial schedule is one where actions from different transactions are not interleaved What are the 3 types of conflicts when two actions act on the same data? - AnswerWrite-read conflicts (WR) Read-write conflicts (RW) Write-write conflicts (WW) What is a dirty read? - Answer When one transaction writes data, and a secondtransaction reads that data before it commits

What is a write-read conflict? - Answer When one transaction writes data, and a secondtransaction reads same data before it commits

What is a read-write conflict? (AKA unrepeatable read) - Answer When one transactionreads data which is then written by a second transaction

What is a write-write conflict? (AKA lost update) - Answer When one transaction writesdata that has already been read or written by a second, incomplete transaction

Two schedules are view-equivalent if - Answer They contain the same transactions

What is the lock manager? - Answer Keeps track of which locks have been issued totransactions

What is a lock table? - Answer A hash table with the data object ID as the key What does each lock table entry contain? - Answer The number of transactions holdinga lock on the object Type of lock (shared or exclusive)A pointer to a queue of lock requests

When are the only times a shared lock request is granted? - Answer The request queueis empty The object is not locked in exclusive mode When are the only times a exclusive lock is granted? - Answer If there is no lock on theobject and request queue is empty

What are update locks? - Answer Allows a transaction to read a record, but can be laterupgraded to an exclusive lock

When can update locks be granted? - Answer When another transaction has a sharedlock

What are increment locks? - Answer They allow objects to be incremented ordecremented

T or F: Only one increment lock is allowed on the same object - Answer F. Multiple. Can other locks be granted on objects with increment locks? - Answer No.