• Keine Ergebnisse gefunden

Quiz Sheet No. 4 for

N/A
N/A
Protected

Academic year: 2022

Aktie "Quiz Sheet No. 4 for"

Copied!
3
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Quiz Sheet No. 4 for Architecture and Implementation of Database Systems Prof. Rudolf Bayer, Ph. D.

Institut für Informatik SS 2003

Exercises for Chapter 5.2.4: Cache/Safe Method

1. Reconsider schedule H2 of Exercise 2c) of Quiz Sheet No. 3:

timeline

a) Determine the different states of the database, the cache and the safe along the timeline from timestamp 1 to 13 using the following schema. For each step fill in the appropriate objects. Indicate R- and A-locks on objects u, y, z using this notation: obj(C)RA, where

- obj is the respective object,

- C is an ordered list of all transactions (use indices 1, 2, 3 for t1, t2, t3) that have changed the object in the past (on commit),

- R is a list of all transactions that hold an R-lock on the object, and

- A is a list of all transactions that hold an A-lock on it

Example: z(3,1)13,2 indicates, on the one hand, that object z has been altered first by transaction t3 and then by t1, and on the other hand, that currently transactions t1 and t2 hold R-locks on z, while t3 holds an A-lock. Assume that old versions of objects are removed from the cache when a committing transaction writes their new versions into the database.

t1 t2 t3

r(u) 1

r(z) 2

r(y) 3

r(u) 4

r(y) 5

w(y) 6

w(z) 7

ct 8

r(z) 9

w(z) 10

r(z) 11 r(y) 12

w(u) 13

ct 14

r(u) 15 w(u) 16 ct 17

(2)

Schema:

Answer:

b) Show that in timestamps 14 to 17 a deadlock occurs between transactions t1 and t3.

Answer:

DB Cache Safe

⇒ t1 waits for t3 to release its R-locks on z(2) and y, t3 waits for t1 to release its A-lock on u

⇒ deadlock

DB Cache Safe

0 u, y, z

1 u, y, z u1

2 … … …

… 13

DB Cache Safe

0 u, y, z

1 u, y, z u1

2 u, y, z u1, z2

3 u, y, z u1, z2, y1 4 u, y, z u1,2, z2, y1 5 u, y, z u1,2, z2, y1,2 6 u, y, z u1,2, z2, y12 7 u, y, z u1,2, z2, y12

8 u, y, z(2) u1, y1 , z(2) z(2) 9 u, y, z(2) u1, y1, z(2)1 z(2) 10 u, y, z(2) u1, y1, z(2)1 z(2) 11 u, y, z(2) u1, y1, z(2)13 z(2) 12 u, y, z(2) u1, y13, z(2)13 z(2) 13 u, y, z(2) u1, y13, z(2)13 z(2)

14 u, y, z(2) t1 → t3 [z(2) and y] z(2) 15 u, y, z(2) u13, y13, z(2)13 z(2) 16 u, y, z(2) u3, y13, z(2)13 z(2) 17 u, y, z(2) t3 → t1 [u] z(2)

(3)

c) Complete the Cache/Safe listing of exercise 1a) assuming that t3 does not set R-locks on objects z and y (at timestamps 11 and 12).

Answer:

DB Cache Safe

13 u, y, z(2) u1, y1, z(2)1 z(2)

14 u(1), y(1), z(2,1) y(1), z(2,1), u(1) z(2), y(1), z(2,1), u(1) 15 u(1), y(1), z(2,1) y(1), z(2,1), u(1)3 z(2), y(1), z(2,1), u(1) 16 u(1), y(1), z(2,1) y(1), z(2,1), u(1)3 z(2), y(1), z(2,1), u(1) 17 u(1,3), y(1), z(2,1) y(1), z(2,1), u(1,3) z(2), y(1), z(2,1), u(1,3)

Referenzen

ÄHNLICHE DOKUMENTE

date integer date on format yyyymmdd time integer 24 h time on format hhmm bottom_depth integer bottom depth in meters sample_depth integer sample depth

In this respect the paper contributes to the understanding of the well known Cagan inflationary finance models failure with perfect foresight and provides a test for

While the leading term in the corresponding Weyl expansion is proportional to the billiard area, we find that the contribution that usually scales with the total length of the

Rebsamen, Jürg; Reimer, Manuel; Ursprung, Peter; Zehnder, Carl August Publication

2) Cuando está activado el selector del modo de gran total/fijación de tipos (posición GT), el contador contará el número de veces que se han almacenado los resultados de cálculo

Just like the multilevel system of governance that is at the heart of the three papers, the papers themselves consider the different levels: the first paper focuses on the direct

The author uf the second best Essay to receive a prize.. of five huodred rupees; and the author of the third

The rate of tangible assets is calculated as a report between tangible assets and total assets, measuring the enterprise ability to resist to a crisis or to develop according