ontos ( formerly vbase) presentation - class csci 397c student: son doan date: november 11, 1999
Post on 21-Dec-2015
219 views
TRANSCRIPT
![Page 1: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/1.jpg)
ONTOS ( formerly VBase)
Presentation - class CSCI 397CStudent: Son Doan
Date: November 11, 1999
![Page 2: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/2.jpg)
ONTOS (formerly VBase)
Introduction What is ONTOS (formerly VBase)? Basic Architecture of ONTOS Applications Setup a Working Database Using DBATool Accessing Persistent Objects Metaschema Transaction control Object SQL
![Page 3: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/3.jpg)
Introduction
GemStone from Servio Corporation, based on SMALLTALK.
ONTOS from Ontos,Inc., based on C++. O2 from O2 Technology,based on O2C. ObjectStore, based on C++. Objectivity/DB, based on C++. Versant, based on C++.
![Page 4: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/4.jpg)
Approaches for OO DBMSs
Extend a programming language.
Example: GemStone (extends SMALLTALK)
Extend a data model such as relational
data model with object-oriented features.
Example: Oracle, IBM DB2
Provide extendible object-oriented DBMS
libraries. Example: ONTOS
![Page 5: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/5.jpg)
What is ONTOS?
A commercial product of Ontos of Billerica, Massachussettes
Based on making C++ into a database programming language
Provides a persistent object store for C++ Activate and deactivate objects Handle concurrency Incorporate ObjectSQL
![Page 6: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/6.jpg)
Application Process
Virtual Application code
Memory
Client
Local Area Network
ONTOS’ Client-Server Architecture
![Page 7: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/7.jpg)
ONTOS’ Client-Server Architecture (cont.)
Local Area Network
Database Primary Secondary
Registry Server Server
File System File System
Distributed database
![Page 8: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/8.jpg)
ONTOS object database
A distributed database and based on the client/server architecture for data interaction.
The server side manages the data store The client side provides the interface to
user processes and manages the mapping of data to the application process’ virtual memory space.
![Page 9: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/9.jpg)
Large data-intensive applications
3 major components of the integrated object system:
The kernel database: “meta-schema” basic functionality.
The class libraries and the header files The utility programs
![Page 10: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/10.jpg)
Setup a Working Database Using DBATool
% cd <dir> % cp /usr/local/ONTOS/ONTOSDB/db/OntosSchema
myKernel % DBATool >> register kernel tutorialKern on <host> at
<dir>/myKernel >> register database tutorialDB with kernel
tutorialKern >> quit
![Page 11: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/11.jpg)
Accessing Persistent Objects
Naming of Objects
Activation of Persistent Objects
Deactivation of Persistent Objects
Deletion of Objects
![Page 12: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/12.jpg)
Naming of Objects
The name of an object can serve as an
entry point to the database.
The name of an object is typically set in
the constructor.
Name is an inherited attribute from the
root class Object.
![Page 13: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/13.jpg)
Naming of Objects (Example)
class Thing: public Object {
private:
int priv_value;
public:
Thing(int aValue, char* theName);
int getValue();
void setValue();
};
![Page 14: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/14.jpg)
Naming of Objects (Example)
// Constructor
Thing::Thing(int aValue, char* theName) : Object ( theName ) {
priv_value = aValue;
}
A Thing can then be created as follows:
myThing = new Thing(someValue, “myFavoriteThing”);
![Page 15: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/15.jpg)
Access a persistent object
ONTOS’s class Object provides the function OC_lookup() to access a particular object in the database
Example:
Thing *myThing = (Thing*)OC_lookup(“myFavoriteThing”);
![Page 16: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/16.jpg)
Activation of Persistent Objects
Activation initiates transferring the object’s state from the database to main-memory and transforming references.
A single object: using OC_lookup(). All objects contained in an Aggregate: using
OC_getCluster() All objects reachable from a particular object:
using OC_getClosure().
![Page 17: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/17.jpg)
Activation of Persistent Objects
Object OC_lookup ( char *objectName,
LockType lock = readLock, …);
Object OC_getCluster ( char *clusterName,
LockType lock = readLock, …);
Object OC_getClosure ( char *objectName,
LockType lock = readLock, …);
![Page 18: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/18.jpg)
Deactivation of Persistent Objects
An object is deactivated with the operation void Object::putObject();
An entire Aggregation is deactivated with void Aggregate::putCluster(…);
Implicitly achieved by deleting with
void Object::deleteObject();
void Object::deleteCluster();
![Page 19: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/19.jpg)
Metaschema
Metaschema provides the underlying support that allows a form of access called programmatic access to database.
Metaschema classes include:- Type- PropertyType- PropertyIterator
![Page 20: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/20.jpg)
Metaschema (Example)
Type* the ThingType = (Type*) OC_lookup ( “Thing” );
Type* propertyType = (Type*) OC_lookup ( “Thing::priv_value” );
PropertyIterator* propIter = new PropertyIterator ( theThingType );
while ( propIter->moreData() ) {
// get result with operator() function
… }
![Page 21: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/21.jpg)
Compare OntosDB with C++
OntosDB C++
============================= Type class Property data member Procedure member function Supertype base class Subtype derived class
![Page 22: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/22.jpg)
Transaction Control
In a database with many concurrent users, conflict between users must be resolved.
Atomicity of change Transaction data pool 3 kinds of transactions:
– Basic transactions– Nesting transactions– Shared transactions
![Page 23: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/23.jpg)
Basic Transactions
3 graduations for locking objects: read lock, write lock, or no lock.
The interface to the transaction mechanism consists of 3 functions: TransactionStart TransactionCommit TransactionAbort
![Page 24: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/24.jpg)
Nesting Transactions
Transaction may be nested (i.e., multiple TransactionStart calls without intervening commits or aborts are activated).
Nested transactions make long transactions more practical. A single long transaction can be divided into a series of many small nested transactions.
![Page 25: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/25.jpg)
Shared Transactions
Cooperating processes can share a single transaction.
The first process to issue a TransactionStart call initiates the transaction. Subsequent processes issuing a TransactionStart call with the same name simply join it.
A shared transaction may be thought of as one in which the transaction data pool is visible to all processes participating.
![Page 26: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/26.jpg)
ObjectSQL
The interface of the two incompatible
systems C++ and Ontos utilizes
QueryIterator class.
Begin with OC_startQuerySession()
End with OC_endQuerySession().
![Page 27: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/27.jpg)
ObjectSQL (Example)
OC_startQuerySession();
QueryIterator *myQuery;
myIter = new QueryIterator(“(select * from Thing where getValue() = 100)”);
while(myIter->moreData()) {
// get each Thing and process it somehow
}
delete myIter;
OC_endQuerySession();
![Page 28: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/28.jpg)
ObjectSQL (cont.)
The resulting collection of objects satisfying the SQL query can be obtained by using QueryIterator::moreData().
To get each object of the result collection, use QueryIterator::YieldRow()
Example:ArgumentList *anArgList = myIter->YieldRow();
Entity *ptr = (Entity *) (*anArgList)[0];
![Page 29: ONTOS ( formerly VBase) Presentation - class CSCI 397C Student: Son Doan Date: November 11, 1999](https://reader035.vdocument.in/reader035/viewer/2022062516/56649d545503460f94a311fb/html5/thumbnails/29.jpg)
References Alfons Kemper. Object-Oriented Database Management.
Prentice Hall, New Jersey, 1994. George Wilkie. Object-Oriented Software Engineering.
Addison-Wesley, 1993. R.G.G. Cattell. Object Data Management. Addison-Wesley,
1991. James A. Larson. Database Directions. Prentice Hall, New
Jersey, 1995. Setrag Khoshafian, Razmik Abnous. Object Orientation.
John Wiley & Sons, Inc., 1995. A.A van Rossum. URL:
http://is.twi.tudelft.nl/databases/1996/ontos/report/ontos.html