Docsity

Information Systems - Problem Set 6 Solutions | CMPSCI 445, Assignments of Management Information Systems

Toggle sidebar
bg1
CMPSCI 445 โ€” Homework 6
Solutions
75 Points
Due May 5th, submitted electronically or to the CS office.
Typed solutions preferred. If hand-written, solutions must be legible.
Transaction Management
1. (45 points) Analyzing schedules
For each of the following schedules, state which of the following properties hold: conflict serial-
izable,recoverable,cascadeless, or strict. A schedule is strict if a value written by a transaction
T is not read or overwritten by other transactions until T either aborts or commits.
Please display your answer as a table with one row per schedule, and one column per property.
Indicate the satisfied properties with a check mark.
Reminder: a conflict serializable schedule is one that has no conflicting operations amongst its
committed transactions. Aborted transactions are ignored when determining conflict serializ-
ability.
(a) T1:W(X), T2:R(X), T1:W(X), T2:Commit, T1:Commit
(b) T1:R(X), T2:W(X), T1:W(X), T2:Abort, T1:Commit
(c) T1:R(X), T2:W(X), T1:W(X), T2:Commit, T1:Commit
(d) T1:R(X), T2:R(X), T1:W(X), T1:Commit, T2:W(X), T2:Commit
(e) T1:W(X), T2:R(X), T1:W(X), T2:Commit, T1:Abort
(f) T1:W(X), T2:R(Y), T1:R(Y), T2:R(X), T1:Commit, T2:Commit
(g) T1:R(X), T2:R(X), T1:Commit, T2:W(X), T2:Commit
Schedule Conflict serializable Recoverable Cascadeless Strict
(a)
(b) โˆš โˆš โˆš
(c) โˆš โˆš
(d) โˆš โˆš โˆš
(e) โˆš
(f) โˆš โˆš
(g) โˆš โˆš โˆš โˆš
1
pf2

Partial preview of the text

Download Information Systems - Problem Set 6 Solutions | CMPSCI 445 and more Assignments Management Information Systems in PDF only on Docsity!

CMPSCI 445 โ€” Homework 6

Solutions

75 Points

Due May 5th, submitted electronically or to the CS office. Typed solutions preferred. If hand-written, solutions must be legible.

Transaction Management

  1. (45 points) Analyzing schedules

For each of the following schedules, state which of the following properties hold: conflict serial- izable, recoverable, cascadeless, or strict. A schedule is strict if a value written by a transaction T is not read or overwritten by other transactions until T either aborts or commits. Please display your answer as a table with one row per schedule, and one column per property. Indicate the satisfied properties with a check mark. Reminder: a conflict serializable schedule is one that has no conflicting operations amongst its committed transactions. Aborted transactions are ignored when determining conflict serializ- ability.

(a) T1:W(X), T2:R(X), T1:W(X), T2:Commit, T1:Commit (b) T1:R(X), T2:W(X), T1:W(X), T2:Abort, T1:Commit (c) T1:R(X), T2:W(X), T1:W(X), T2:Commit, T1:Commit (d) T1:R(X), T2:R(X), T1:W(X), T1:Commit, T2:W(X), T2:Commit (e) T1:W(X), T2:R(X), T1:W(X), T2:Commit, T1:Abort (f) T1:W(X), T2:R(Y), T1:R(Y), T2:R(X), T1:Commit, T2:Commit (g) T1:R(X), T2:R(X), T1:Commit, T2:W(X), T2:Commit

Schedule Conflict serializable Recoverable Cascadeless Strict (a) (b)

(c)

(d)

(e)

(f )

(g)

  1. (30 points) Locking

(a) Consider the following schedule:

T1:R(A), T1:W(A), T2:R(A), T2:W(A), T2:R(B), T2:W(B), T2:Commit, T1:Abort i. Is this schedule allowed by Two Phase Locking? If not explain why. If so, show the schedule with lock requests and releases obeying 2PL. Allowed by 2PL. ii. Is this schedule allowed by Strict Two Phase Locking? If not explain why. If so, show the schedule with lock requests obeying Strict 2PL. Not allowed by Strict 2PL. (b) We call a transaction that only reads database objects a read-only transaction. Other- wise the transaction is called a read-write transaction. Give brief answers to the following questions: i. What is lock thrashing and when does it occur? Locking thrashing occurs when the database system reaches a point where adding another new active transaction actually reduces throughput due to competition for locking among all active transactions. Empirically, locking thrashing is seen to occur when 30% of active transactions are blocked. ii. What happens to the database system throughput if the number of read-write trans- actions is increased? If the number of read-write transaction is increased, the database system throughput will increase until it reaches the thrashing point; then it will decrease since read-write transactions require exclusive locks, thus resulting in less concurrent execution. iii. What happens to the database system throughput if the number of read-only transac- tions is increased? If the number of read-only transaction is increased, the database system throughput will also increase since read-only transactions require only shared locks. So we are able to have more concurrency and execute more transac- tions in a given time. iv. Describe three ways of tuning your system to increase transaction throughput. Throughput can be increased in three ways:

  • By locking the smallest sized ob jects possible.
  • By reducing the time that transaction hold locks.
  • By reducing hot spots, a database object that is frequently accessed and modified.