Question 1: Warmup

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Middleware WS 2020/21

Prof. Dr.-Ing. Stefan Deßloch


Gajendra Doniparthi
TU Kaiserslautern, FB Informatik – Lehrgebiet Informationssysteme http://lgis.informatik.uni-kl.de
Exercise Sheet 1: Out date 02.11.2020 12:00 PM, Due date 09.11.2020 12:00 PM

Question 1: Warmup
In information systems, we have four properties which are desirable for transactional events. These are
atomicity, consistency, isolation and durability. Briefly explain each of these properties and give a
short example of their application.

Question 2: Information Systems Architecture


In the lecture, we discussed the concept of tiers to implement information systems. Discuss the types of
tier based architectures and also the pros and cons of each architecture type.

Question 3: Transaction Distribution


Information systems are most often composed of distributed systems such as database systems, applica-
tion servers, or legacy applications, for instance. Middleware is used to hide the distribution from the
application programmer and provide a single system image. Different units of distribution are feasible.
Four alternatives have been presented in the class, namely, transaction routing, programmed distribu-
tion, distributed database operations, and DBMS-controlled distribution. Consider the following table
definitions and scenario:

CREATE TABLE l e c t u r e (
l e c t u r e I D INTEGER NOT NULL PRIMARY KEY,
t i t l e VARCHAR( 2 5 5 ) NOT NULL,
l e c t u r e r VARCHAR( 2 5 5 ) NOT NULL,
t i m e s l o t INTEGER NOT NULL,
d e s c r i p t i o n VARCHAR( 2 5 5 )
);

CREATE TABLE r e s e r v a t i o n (
roomID CHAR( 6 ) NOT NULL,
t i m e s l o t INTEGER NOT NULL,
l e c t u r e I D INTEGER NOT NULL,
PRIMARY KEY( roomID , t i m e s l o t )
);

These tables exist in two different legacy information systems. One legacy system keeps the lecture data,
and the other one the reservations. Scheduling a lecture involves both: updating the lecture catalog and
reserving a lecture room. Note that certain lectures must not overlap, i.e. scheduling a lecture may fail
due to time conflicts. Similarly, reserving a lecture room fails if the room is unavailable.

• Assuming that remote procedures are available to reserve the lecture rooms and catalogue lectures,
for the following pseudo code snippets, identify the unit of distribution from the four alternatives
discussed in the lecture. Briefly explain if a certain alternative is (not) well suited for the functio-
nality we want to implement.

a)
// code s n i p p e t
...

1
Middleware WS 2020/21
Prof. Dr.-Ing. Stefan Deßloch
Gajendra Doniparthi
TU Kaiserslautern, FB Informatik – Lehrgebiet Informationssysteme http://lgis.informatik.uni-kl.de
Exercise Sheet 1: Out date 02.11.2020 12:00 PM, Due date 09.11.2020 12:00 PM

r e s e rv e L e c t u re R o o m ( l e c t u r e I D , t i t l e , l e c t u r e r , t i m e s l o t , d e s c r i p t i o n ) ;
c a t a l o g L e c t u r e ( roomID , t i m e s l o t , l e c t u r e I D ) ;

...

b)
// code s n i p p e t
...

beginTransaction ( ) ;

try {
r e s e rv e L e c t ur e R o o m ( l e c t u r e I D , t i t l e , l e c t u r e r , t i m e s l o t , d e s c r i p t i o n ) ;
c a t a l o g L e c t u r e ( roomID , t i m e s l o t , l e c t u r e I D ) ;
}
c a t c h ( RoomOccupiedException e ) {
rollback ();
System . e r r . p r i n t l n ( ”Room i s a l r e a d y r e s e r v e d . ” ) ;
}
catch ( LectureCollisionException e ) {
rollback ();
System . e r r . p r i n t l n ( ” L e c t u r e i s c o l l i d i n g with a n o t h e r l e c t u r e . ” ) ;
}

commit ( ) ;

...

• Write code snippets for scheduling a lecture using Alternative 3 (database operations as unit of
distribution) and Alternative 4 (distribution controlled by a Federated DBMS).

You might also like