• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/26

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

26 Cards in this Set

  • Front
  • Back
  • 3rd side (hint)
What are the properties of a transaction?

Atomicity - atomic unit of processing


Consistency preservation - correct execution of transactions must take the database from one consistent state to another


Isolation - updates should not be visible to other transactions until committed.


Durability or permanency - Changes to the database are kept and not lost

Just think of ACID...

What is the database system log?

What is it used for?

Record of all transaction operations that affect the values of database items.


Used for transaction recovery.

What is a recoverable schedule?

One where committed transactions are not rolled back.

What is a cascadeless schedule?

Where one rollback will not cause consecutive rollbacks.

What is a strict schedule?

Transaction can neither read or write an item x until the last transaction that wrote x has committed (or aborted).

What is a serial schedule?

Where every transaction starts and finishes consecutively without interruption.




[affects concurrency]

Why is a serial schedule correct?

Transactions are independent and atomic(ACID)




[limits concurrency]

What is a serializable schedule?

One that is equivalent to some serial schedule of the same [n] transactions.




[achieves efficient concurrent execution]

What are the three ways that we have learned to measure the equivalence of two schedules?

Result equivalent - where two schedules produce the same final state of database.


Conflict equivalent - where two schedules contain like conflicting operations.


View equivalent - the same transactions and order exist in S1 and S2.

What is the difference between a shared lock and an exclusive lock?

Shared - read mode that can be shared among multiple transactions.


Exclusive - write mode that once set, is exclusive to only the setting transaction.

What are well formed read/write?

Transactions that 1) lock data items before reading or writing to it. 2) must not try and lock an already locked data item 3) must not try and free already freed data items

What is the definition of 2PL?

Two-Phased Locking Protocol where all locking is done only before unlocking. Also no locking after the first unlock.

What is the definition of Strict 2PL?What is the corresponding benefit?

A transaction does not release any write lock until committed or aborted. Guarantees a strict schedule.

What is the definition of Rigorous 2PL. What is the corresponding benefit?
A transaction does not release any lock until committed or aborted. Easier to implement.
The definition of conservative 2PL. Why can conservative 2PL prevent deadlock?

Where a transaction locks all data items it refers to before execution. Waits until all locks can be performed to prevent deadlock.

What is the definition of starvation?

When a transaction consistently waits or restarts and never gets a chance to proceed further.

What is the definition of the READ UNCOMMITTED isolation level?

Transaction mode that allows Dirty Read, Non-repeatable Read, and Phantom phenomena.

What is the definition of the READ COMMITTED isolation level?

Transaction mode that allows Non-repeatable Read and Phantom phenomena.

What is the definition of the REPEATABLE READ isolation level?

Transaction mode that allows only Phantom phenomena.

What is the definition of the SERIALIZABLE isolation level?

Transaction mode that adheres to our notion of serializability of interleaved execution.

What is a long duration transaction?

Lock for human interaction with the database and only unlocks after human is done.

Decide whether the following schedule is an unrecoverable, recoverable, cascadeless orstrict schedule:




r3[z], r1[y], w2[x], c2, w3[z], c3, r1[x], w1[z]

The schedule is Strict because only committed data is read and written.

Decide whether the following schedule is an unrecoverable, recoverable, cascadeless or strict schedule:




r1[x], w2[y], w1[x], r3[z], c1, r3[x], w3[y], c2

The schedule is Cascadeless because every transaction reads only the items that are written by committed transaction.


Decide whether the following schedule is an unrecoverable, recoverable, cascadeless or strict schedule:



w2[y], w1[y], r3[y], w3[y], c2, c3.

The schedule is Unrecoverable. T3 overwrites T1 which in turn overwrites T2 before commit.

Find all the conflicting pairs in the following schedule:


w2[x], r1[x], r3[y], w3[y], w1[x], r2[y], w1[y]

(w2[x], r1[x]), (w2[x], w1[x]), (r3[y], w1[y]), (w3[y], r2[y]), (w3[y], w1[y]), (r2[y], w1[y])

Must meet ALL three conditions:


- belong to different transactions


- access the same data item


- at least one write

Draw a serializable graph for the following conflicting pairs:




(w2[x], r1[x]), (w2[x], w1[x]), (r3[y], w1[y]), (w3[y], r2[y]), (w3[y], w1[y]), (r2[y], w1[y])

Draw arrows from source to sink!


Look for a cycle!