Study your flashcards anywhere!

Download the official Cram app for free >

  • 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

How to study your flashcards.

Right/Left arrow keys: Navigate between flashcards.right arrow keyleft arrow key

Up/Down arrow keys: Flip the card between the front and back.down keyup key

H key: Show hint (3rd side).h key

A key: Read text to speech.a key

image

Play button

image

Play button

image

Progress

1/30

Click to flip

30 Cards in this Set

  • Front
  • Back

Problems, that can arise in concurrent systems.

1. Lost update problem


2. Uncommitted dependency problem


3. Inconsistent analysis problem

Describe the lost update problem!

Describe the uncommitted dependency problem!

Describe the inconsistent analysis problem!

What is the most common solution for concurrency?

Locking:


Shared (S) lock: multiple can read.


Exclusive (X) lock: one can read and write.



LOCKS ARE RELEASED AT THE END OF THE TRANSACTION!

Solution for lost update.

Solution for Uncommitted dependency problem!

Solution for the inconsistent analysis problem!

What do we call a schedule in transaction management?

The order in which multiple transaction's statements are executed.

When is a schedule serial?

When transactions are executed fully without overlap.

When is a schedule serializable?

There is an overlap in the execution of transactions but the end result is as there weren't any overlap.

When do two statements from different transactions conflict?

If at least is a write statement

When are two schedules conflict equivalent?

1. Both schedules include the same tranacts. (in the same order)



2. They have the same set of conflicting operations.

When are two schedules conflict equivalent?

1. Both schedules include the same tranacts. (in the same order)



2. They have the same set of conflicting operations.

When is a schedule conflict serializable

If it is equivalent to a serial schedule.

What is two phase locking.

1. Acquisition of locks


2. Releasing of locks



If a transaction follows two phase locking, that is a conflict serializable schedule, therefore it is serializable.



Not used in commercial dbms' due to overhead.

Describe the use of timestamps to achieve serializability.

1. Each transaction is given a unique timestamp.


2. The DBMS ensure that the access to records follow this order.

Explain the timestamp algorithm!

READ transactions:


T < O(TW) -> rollback


else -> read (update O(TR) if O(TR) < T).



WRITE transactions:


T < O(TR) -> rollback


T < O (TW) -> do nothing


else write (update O(TW)).

What do we call cascade effect?

In timestamp based concurrency control if a transaction is rolled back, other transactions that depend on data it produced have to be rolled back too.

What is the Thomas Write rule?

If an object has been modified by a transaction with higher timestamp, the modification can be omitted.

How is the lost update problem resolved by timestamps?

When it gets to the WRITE, a later transaction has already read it, so it rolls back.

How is the Uncommitted dependency problem resolved by timestamps?

When it rolls back, it forces the transactions that read the same objects, it had modified, to roll back too.

How is the inconsistent analysis problem resolved by timestamps?

It rolls back at the end, when it can see that a younger transaction modified the object.

Describe the multiversion concurrency control technique!

WRITE:


Every write operation creates a new, modified version of the object and sets O(TR) to the time the operation has been finished.


READ:


Looks up the latest version that was committed before the transaction's timestamp.



Two WRITE operations lock each other, there is no locking for reads.

Describe the multiversion solution for the lost update problem!

Same as locking, deadlock is possible.

Describe the multiversion solution for the uncommitte dependency problem!

Dirty read will not occur because the later transaction will read the last committed version of the object.

Describe the multiversion solution for the inconsistent analysis problem!

The read at the end is going to read the last committed version of the object.

List the SQL isolation levels!

1. READ UNCOMMITTED no guarantee


2. READ COMMITTED garantees P1


3. REPEATABLE READ garantees P1, P2


4. SERIALIZABLE garantees P1, P2, P3

What are the phenomenas?

P1 Dirty read


P2 Non-repeatable read: a transaction cannot read an object for the second time if the object had been modified by another transaction in the meantime.


P3 Phantom: if a set of rows have been modified by another transaction since the first search (SELECT) , rows that now satisfy the condition have to be included.

How does ORACLE handle concurrency?

Multiversion


Non-serializable by default