Solution of Assignment No. 4
Object Oriented DBMS – CS713
Muhammad Mustafa - MS120400114
Question No.1
(15 Marks)
How partition inheritance can be
implemented using relational approach? Give an example of hierarchy for
partition inheritance. How it can be implemented using object oriented features
in Oracle.
Answer:
Implementation of
partition inheritance using relational approach:
It
is much similar to the mutual-exclusion inheritance with few differences as
followings:
·
A super class is
created with an attribute showing the type.
·
The type
attribute must have one and only one of the subclass types.
·
The type
attribute is not allowed to have null value.
·
The object is
not allowed to be only of the super class type.
Example of hierarchy
for partition inheritance:
Suppose
that there are three posts in a company; data entry operator, data analyst, and
administrator. All posts have some different attributes. All posts have a
common attribute. The common attribute will be included in super class and the
super class will have and attribute showing the type of post with three type
options. This attribute is not allowed to be null. Now the sub classes would be
data entry operator, data analyst, and administrator. It will be compulsory for
a new object to have the common attribute from super class and other relevant attributes
from one and only one of the tree sub classes.
Implementation using
object oriented features in Oracle:
·
A super class
type is created
·
A table is
created from super class having a additional attribute
·
One type is also
created for each of the sub class
·
The table for
sub class is not created
·
The additional
attribute of the table created from super class can contain only one type out
of the three sub class types.
·
The Under
keyword is used
·
The null is
removed from the additional attribute as opposite to the mutual-exclusion
inheritance
Question No.2
(15 Marks)
Elaborate the Objectivity/C++
Programming Interface (PI). Categorize the classes for storage object in O/DB
C++ PI. Discuss the concept of handles in Objectivity/C++?
Answer:
Elaboration of
Objectivity/C++ PI:
It
provides sessions and connections objects.
It
helps in developing application and the interaction between O/DB and
application.
It
has global classes and objects in the DDL.
Class
ooObjy gives the static methods for interactions.
Object
iterators are used to traverse the collections.
It
provides exception classes for error handling.
There
are two process involved in it. These are:
·
Federated
DB services: It takes the data used in the
application as a federated database. The processes used become the part of the
application. In this way the application becomes efficient in processing.
·
Lock
Server: Lock server resides on federated databases. It does
not become the part of the application. Concurrent accesses happen on a
database, and lock sever provides the concurrency control mechanism.
The
other part involves transaction:
·
Transaction is a
part of the application where data accesses are made to the databases.
Transactions are not themselves the applications. Transaction manages all
processes that manage data.
·
A transaction
has a begin and an end. The transaction updates data temporarily unless the
commit command is received.
·
There is a check
pointing concept in transaction. During a transaction execution when a
checkpoint appears the data is stored to the database. Same is done for several
checkpoints that appear during a transaction. If a transaction is decided to be
aborted all the data saved into the database by checkpoints is undone.
·
The ACID
properties are also supported
Categorization of
classes for storage objects in O/DB C++ PI:
There are two categories persistent and
storage:
Persistent:
·
Basic
Objects: these are the object used in the application for
storing data defined by the user and supported by the O/DB tools
·
Containers:
these
use the cluster and groups the objects for getting efficiency in processing. The
unit of locking is also used. It means the same type of container will be
provide to the application and data as the type of operation is being applied
to the data. The level of the locking is container. The level may also be to
the containing object but the cost of processing will increase.
Storage:
·
Database:
it is implemented in case of a physically file. It keeps the application
containers and system containers. All the containers in a database will be
physically present in one database and not distributed among different database
of different locations. However, the databases may be on different locations.
·
Federated
DB:
it has the system and application databases. It also contains a system DB that
keeps the global catalog and schema. The schema do not dependant on any
language. The FDB will be created by using any tools.
Concept of Handles in
Objectivity/C++:
Handles
are used to refer O/DB objects by O/C++ applications. They are used to access
the member functions as well. Handles are used to store the states of memory
management. Open handle contains in memory OID and closed pointers contain on
disk based OID.
Question No.3
(15 Marks)
Elaborate the session usage models with
the help of diagrams in
Objectivity/C++:
(i) One thread multiple session
(ii) Multiple threads, each with its
own session
(iii) Multiple Threads sharing a
session
Answer:
(i) One thread,
multiple sessions:
A
thread is created in application area. The thread has multiple sessions and
session has transactions in them. A thread has only one session at a time out
of multiple sessions. All other sessions are detached from the thread and only
one session is attached to the thread. The attached session becomes the current
session.
(ii) Multiple threads, each
with its own session:
Here
the main thread is created. And then other threads are created during the main
thread. A separate session is created for each of the thread and inside the
corresponding threads. When the session is completed for the non-main threads
they are closed with terminate thread commands. But when the main thread
completes its session it is closed the shutdown command.
(iii) Multiple threads,
sharing a session:
A
main thread is created in the application area. A session is created. A thread
is created the session is attached to the thread. After a time the session is
detached from the thread and the thread is terminated. A new thread is created.
The same session is attached to the new thread. The session executes. After a
time the session is again detached. The new thread is terminated. The same
process continues. At the last the session is attached to the main thread. When
the session completes the main thread is shutdown.
Question No.4
(5 Marks)
Discuss the concept of Memory
Management in Object Oriented Distributed Database Management Systems
(OODDBMS).
Download: Click Here