Transaction Assignment
Transaction Assignment
2. Explain how the use of Strict 2PL would prevent interference between the two
transactions.
3.Strict 2PL is used in many database systems. Give two reasons for its popularity.
4. Consider a database with objects X and Y and assume that there are
two transactions T1 and T 2. Transaction T 1 reads objects X and Y and then writes
object X. Transaction T 2 reads objects X and Y and then writes objects X and Y .
5. We call a transaction that only reads database object a read-only transaction, otherwise the
transaction is called a read-write transaction. Give brief answers to the following questions:
1. What is lock thrashing and when does it occur?
2. What happens to the database system throughput if the number of read-write
transactions is increased?
3. What happens to the database system throughput if the number of read-only
transactions is increased?
4. Describe three ways of tuning your system to increase transaction throughput.
Student(snum: integer, sname: string, major: string, level: string, age: integer)
Class(name: string, meets at: time, room: string, fid: integer)
Enrolled(snum: integer, cname: string)
Faculty(fid: integer, fname: string, deptid: integer)
The meaning of these relations is straightforward; for example, Enrolled has one record
per student-class pair such that the student is enrolled in the class.
For each of the following transactions, state the SQL isolation level you would use and
explain why you chose it.
1. Enroll a student identified by her snum into the class named ’Introduction to
Database Systems’.
2. Change enrollment for a student identified by her snum from one class to another
class.
3. Assign a new faculty member identified by his fid to the class with the least number of
students.
4. For each class, show the number of students enrolled in the class.
The Catalog relation lists the prices charged for parts by Suppliers. For each of the
following transactions, state the SQL isolation level that you would use and explain why
you chose it.
The actions are listed in the order they are scheduled and prefixed with the transaction
name. If a commit or abort is not shown, the schedule is incomplete; assume that abort or
commit must follow all the listed actions.
10. Consider the following Concurrency Protocols. 2 PL, strict 2Pl, optimistic, timestamp. For
each of the schedules in the problem 9 above, which of the protocols allows the actions as
specified.
11. Consider the following sequences of actions listed in the order they are submitted to
database
For each sequence and for each of the following concurrency control mechanisms,
describe how the concurrency control mechanism handles the sequence.