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 are commonly occurring object frameworks that many Corba applications will use.
- Compositions of Corba services that are used together in related ways toward common goals. Facilities are more complex that CorbaServices. Corba facilities objects may be bearers for various Corba Services and Corba facilities may often support Corbaservice interfaces.
- Currently divided into two categories: Horizontal and Vertical Facilities. Horizontal facilities (i.e. Information Management Facilities) are application-generic and have highest potential for reuse. Vertical facilities are more application-specific and tend to recur primarily within the application niche for which they are designed.
- For more information see: http://www.qds.com/people/apope/Corba/ap_TheObject.html
Information Management Facilities
- It's one part of Horizontal Facilities.
- The Information Management facilities appear as seven different frameworks:
- Information Modeling
- Information Storage and Retrieval
- Compound Interchange (documents)
- Data Interchange
- Information Exchange
- Data Encoding and Representation
- Time Operations
- These facilities may be viewed as belonging to categories in a layered architecture, with Information Modeling as its higher layer and Data Encoding and Representation as its lowest layer.
Compound Interchange and Data Interchange Facilities
- Both of them belong to Information Management Facilities.
- Compound Interchange Facility: Map components through some form of persistent storage. It includes interfaces for the manipulation and interchange of data via persistent storage ( see persistence service)
- Data Interchange Facility: Services included in the facility are to offer a much wider range of use other than persistent storage. Here are a few types of interchange:
- Domain-specific objects, such as those generated via externalization Corbaservice
- Structured Data, such as OMG IDL defined data types( without externalization service)
- Formatted data, including file formats, such as GIF, TIF, EPS, PDS, EDI, RTF, etc.
- Bulk data, presumably various streams.
- Legacy wrapper to object, such as CDO(compound document object)
- Legacy to Legacy( both with wrapper), only the management of the interchange in under ORB control.
Persistent Object Service (POS)
- This service maintains collections of persistent object for long-term use and organize them for efficient retrieval and working closely with its clients to give application-specific meanings to the consistency, persistency, and access-control restrictions implemented within the service.
- It consists of six entities:
- Persistent Identifier(PID)
- Persistent Object(PO)
- Persistent Object Manager(POM)
- Persistent Data Service(PDS)
- Protocols
- Data Store
- Persistent objects may implement a direct connection and interoperation with the data storage or delegate such operations through POM (Persistent Object Manager)
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.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:
- PID DA.
- DA Objects
- DA Object Factory
- PDS DA
- DAA( Dynamic Attribute Access)
- 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;...); }
Data Store --Record-Oriented Data StoreData 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.
TopThis 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:
- Lock Set Interface (LSI)
- Transactional Lock Set Interfaces (offer the same operations as LSI and prevides reference to Object Transaction Service transactional coordinator.)
- Lock Set Factory Interface (Offer four operations: Create, Create Related, Create Transactional and Create Transactional Related.)
- Lock Coordinator Interface ( Contain Drop Lock operation. Client will call this opration after committing or aborting).