53
C H A P T E R 2 2
O
b
j
e
c
t
B
a
s
e
d
D
a
t
a
b
a
s
e
s
E
x
e
r
c
i
s
e
s
22.1 OODB
a. What is persistence by reachability (from persistent roots), and why is it
appropriate for Java?
. .
.3
22.2 Why is persistence by reachability appropriate for persistent Java?
. .
.3
22.3 What is the template class D
R
e
l
R
e
f
used for in ODMG C++? In other words,
what sort of consistency does it enforce?
. .
.3
22.4 Suggest how to use extensions to aggregation to create nested sets in SQL.
22.5 What is the common motivation for the
template
types d Rel Ref and d Rel Set
in ODMG and what is the difference between the two.
. .
.4
22.6 Give an SQL query with nested subqueries in the select clause to do the follow
ing. Given a relation account(branchname, number, balance) create a relation
22.7 What is the drawback in requiring that each object must have a mostspecific-
type, which must be a type declared by the user? Illustrate using an example.
. .
.3
53
54 Chapter 22 Object-Based
Databases
22.8 Given a collection object
a
of type d
s
e
t
<
d
r
e
f
<
c
u
s
t
o
m
e
r
>>
,
write code to iterate over all
22.9 SQL:1999 permits inheritance of tables, but insists a tuple must belong to a most
specific table.
a. Give an example, using table
r
with subtables s and
t,
to illustrate what this
22.10 Given the nested relation
r
(
t
i
t
l
e
v
a
r
c
h
a
r
(
20
)
,
a
u
t
h
o
r
s
s
e
t
o
f(v
a
r
c
h
a
r
(
20
))),
give an
22.11 Hardware swizzling is generally associated with page level locking. Suppose you
want to implement fine granularity locking in spite of having hardware swizzling (so
as to allow programs to directly access objects without type conversion). Suggest a
way of doing this, assuming the following: on dereferenc- ing an invalid pointer, a
function is called which returns the correct pointer.