Go To ReLated Topics                

Introduction of CORBA
Introduction of CORBAFacilities       
Introduciton of Persistance Service
Concurrency Control Problems
        Solution from CORBA: Concurrency Control Service
        Solution from OODBMS: Multiversion Concurency Control

Useful Links:
 Persistence Issue:       http://www.persistence.com/
CoCoBase                      http://www.thoughtinc.com/cocofree/doc/features.html
                                        http://www.blackwhite.com/
Corba reference guide: http://www.qds.com/people/apope/Corba/index.html   
Corba IIOP:                    http://www.omg.org/corba/corbaiiop.html
java, RMI, and Corba : http://www.omg.org/library/wpjava.html
Introduction, for beginner http://www.omg.org/corba/beginners.html
JavaBean Bridge :          http://www.javasoft.com/beans/software/bridge/

Reference Books:
Building secure and reliable network applications ---By Kenneth P. Birman (Our text book)
The Corba Reference Guide ---By Alan Pope


CORBAFacilities

 

Information Management Facilities

    Top

Compound Interchange and Data Interchange Facilities

Top

Persistent Object Service (POS)

Top

Interfaces in POS:

PID Interface:   An object that wants to be a part of the service should have PID. PID is obtainable from PID                              factory.

         Example:

Interface PID
{ attribute string datastore_type;   //one string attribute that signifies the data store
   string get_PIDstring();                //return the string form of the PID
}

PO Interface:
( Persistent Object Interface) An interface that pass control of persistence to client. It has five operations : Connect, Disconnect, Store, Restore, and Remove. And each of operation hold PID as parameter, which acts as reference to a location within the data store.

Sync Data Interface:
Sometimes PO interface may choose to bear a Synchronized Data interface to meet additional sync requirements.
Two operations are held: Prestore and Postrestore. Both of them may be  useful when synchronizing the object's transient data with the data to make persistent.

POM Interface: (Persistent Object Manager Interface)
Match the image of the PO except he each operation requires an object reference as a parameter in addition to the PID.

PDS Interface: (Persistent Data Services Interface)
It's a higher-level interface for the data store. It  primarily acts as intermediary between the object and the data store.The declaration of PDS is virtually identical to the POM.

Top

Protocols

Three Protocols are used to access Data in Corba:

Direct Access
This design of the DA protocol allows users to access persistent data through typed attributes. These attributes are all data objects defined by DDL ( Data Definition Language). DDL specification appears as an interface with no operations but attributes declarations. So DDL-defined objects have interfaces and therefore Cobra objects have data object references.
Following are interfaces available in DDL speicfication:

  1. PID DA.
  2. DA Objects
  3. DA Object Factory
  4. PDS DA
  5. DAA( Dynamic Attribute Access)
  6. PDS Clustered DA (allows associative creation and access of objects)

All these interfaces allow access and creation of associative grouping of objects. One   may open, create, and copy a cluster. Every cluster has a cluster ID, which can be queried and retured as a sequence.

ODMG-93(inherits from the DA protocol
Close to DA protocol. But ODL is used instead of DDL, and it has its own program language mapping. DA and ODMG-93 are so close that they can implement and surport each other.

Dynamic Data Object (DDO)
A single interface with two attributes, a data type and a PID. Rest of operations can be divided into two main purposes: find use in determining data item, and manipulate properties assoicated with data item.
Example:

interface DDO
{    attribute string object_type;                         //two attributes
      attribute CosPersistencePID::PID p;

      short add_data(); ..                                     //determine data item           
      void get_data_property(                              //manipulate properties.
                in short data_id;
                in short property_id;...);             }

Top


Data Store --Record-Oriented Data Store   

Data Store is a part of the architecture that is most tightly bound to the underlying persistence mechanism. It's a DS Call Level Interface and is compatible with the X/Open, CLI and ODBC. If the data store use DDO protocol, the PDS can delegate directly to the CLI interface.
Top

Concurrency Control Problems

This is always a topic in Distributed Database System. The essential property of the transactional execution model, which is called serializability model, is that it garantees isolation of concurrent transactions.That means transaction can not happen concurrently. If transactions A and B are executely concurrently by client Ca and Cb, database would delay either job A or B  until the other job completes.

But runing transactions one at a time will result in poor performance in real world.We use interleaving technology to help database system run multiple transactions at the same time. One of the methods to implement serializability property is to use locking. The most standard locking protocol, called two-phase locking, allows each transaction holds two kinds of locks: read-lock and write-lock. Read-lock is nunexclusively while write-lock is mutually exclusive: multiple transactions are typeically permitted to rea the same objects concurrently but only one transaction can hold write-lock at a time.

This concurrent control protocol give database system great impovement in performance. But at the same time it occurs a lot of transaction problems in the real world. I found an example from a newsgroup:

"I'm setting up a JDBC to CORBA 3 tier data access system.I've chosen to map each table to a struct in IDL and have a managerinterface to operate on each struct. The methods needed for thedatabase actions are something like getPerson(in string name) and suchlike, but I'll also need update functions.
The question is:
If the user downloads the state of a table (in a struct) then alters itand sends it back for an update, how do you make sure that somone hasn't downloaded the state of the object earlier, but not updated yet? I was going to update the whole state of the object coming from the client. I now realise that if
client one downloads Name1 = Mazda, Name2 = Hewitt
then client 2 downloads the same object
client 1 then updates Name1 = Harry, Name2 = Hewittthen
Client 2 updatesName1 = Mazda, Name2 = Ford
then the name should be Name1 = Harry, Name2 = Ford
but instead it will be Name1 = Mazda, Name2 = Ford.
This way a later version of the object could be written over the earlier. "

From the example, we can see that in this user application. When two client update same data object, the later write opration overwrote the former client 1 update.  Many concurrent systems are prone to bugs because of this sort of mutual-exclusive problem.

Solutions to concurrency control problem from CORBA   

As I know, so far we still have no complete solution to all the concurrent-related problems. In Corba, there is a spcific service served to this issue ---Concurrency Control Sevice (CCS).

Concurrency Control Service(CCS) coordinateds access to the resource across operations that may conflict. It help client to access resource through the acquisition of locks on those resources. The set of locks are called Lock Set. There are five locks avaliable in a lock set: Read, Write, Upgrade, Intention Write and Intention Read. The conflict condition are following:

Requested Intention Read Read Upgrade Intension Write Write
Acquired
Intention Read Conflict
Read Conflict Conflict
Upgrade Conflict Conflict Conflict
Intention Write Conflict Conflict Conflict
Write Conflict Conflict Conflict Conflict Conflict

Two-Phase Transactional locking is implemented in CCS. The point of transaction locking is to avoid viewing any intermedia resluts of the transaction. Two-phase locking acquires and never drop any lock during growing phase(first phase) and releases but not acquire locks during the shrinking phase(second phase). So locks are dropped after the transaction is complete and NO new locks can be acquired during this operation.

There are four interfaces available in CCS:

Top