Term
Give an example transaction where an update can be lost |
|
Definition
|
|
Term
Give an example transaction where inconsistent retreivals are experienced |
|
Definition
|
|
Term
How can lost updates and inconsistent retreival problems be solved in transactions? |
|
Definition
Serially equivalent transactions |
|
|
Term
What are the principles of serial equivalence? |
|
Definition
- All the operations in one transaction precede the operations in the other
- Schedule produced by a concurrency control scheme should be equivalent to a serial schedule in which transactions are executed one after the other
- For two transactions to be serially equivalent, it is necessary and sufficient that all pairs of conflicting operations be executed in the same order for all of the objects they both access
|
|
|
Term
What are some concurrent control approaches? |
|
Definition
- Locking
- Optimistic concurrency control
- Timestamp ordering
|
|
|
Term
Give an example of a recoverability problem |
|
Definition
|
|
Term
What are some abort issues in transactions? |
|
Definition
- Dirty reads - requires recoverability of transactions in place
- Transactions that have seen effects of a transaction that has consequently aborted must delay commit
- Cascading aborts - a consequence of delay commits
- Avoided by only allowing reads on objects that were written by committed transactions
- Premature writes
|
|
|
Term
|
Definition
When a value is read in a transaction that isn't yet committed, but that transaction is aborted, therefore the value read is invalid |
|
|
Term
Give an exmaple diagram of nested transactions |
|
Definition
|
|
Term
What are the principles of nested-transactions? |
|
Definition
- Root is top level transaction
- non-root nodes are subtransactions
- Subtransactions appear atomic to parent in respect with transaction failures and concurrent access
- Transactions in the same level are serially equivalent
|
|
|
Term
What are the advantages of nested transactions? |
|
Definition
- Subtransactions at one level may run concurrently.
- Subtransactions can commit or abort independently
|
|
|
Term
What are the rules for nested transactions? |
|
Definition
- A transaction may commit or abort only after their child transactions have completed
- When a subtransaction completes it makes an independent decision either to commit provisionally or to abort
- When parent aborts, all subtransactions are aborted
|
|
|
Term
Show a transaction with exclusive locks |
|
Definition
|
|
Term
How does an exclusive lock operate? |
|
Definition
- When an operation accesses an object within a transaction:
- If the object is not already locked, it is locked and the operation proceeds
- If the objet has a conflicting lock set by another transaction, the transmission must wait until it is unlocked
- If the object has a non-conflicting lock set by another transaction, the lock is shared and the operation proceeds
- If the object has already been locked in the same transaction, the lock will be promoted if necessary and the operation proceeds. (Where promotion is prevented by a conflicting lock, rule (b) is used)
- When a transaction is committed or aborted, the server unlocks all objects it locked for the transaction
|
|
|
Term
Show an example deadlock with write locks |
|
Definition
|
|
Term
Show a resolution for deadlocks in write locks |
|
Definition
|
|