Object-Oriented Databases: Commercial OODBMS: Objectivity/DB
Object-Oriented Databases: Commercial OODBMS: Objectivity/DB
Smalltalk
Data Replication
SQL++
Python
Tools
Java
XML
Fault Tolerant
C++
C#
Option
Option
Objectivity/DB
Database Servers
Local
Index
Storage and
Transaction
Cache
Client Side
Language
Interfaces
Splitter
Lock Query Data Journal
Server Side
Filter Gateway
Database Database
Federated Database
User-Defined Database
Basic
Objects
Logical Physical
Federation
Schema Federation File e.g. publications.fdb
Database Catalog
1
n
1 n
Objects Slots
objects
Memory Cache Pages
Managed C++ Code
Slot housekeeping ooHandle(...)
(6 bytes per slot)
Objectivity Containers
(with pages)
Prerequisites
install Microsoft Visual Studio 2008
install Objectivity/DB for .NET
copy license file to the Objectivity/DB installation directory
check that lock server runs (run oocheckls from command prompt)
Start Visual Studio 2008
Create a new C# project
select “Empty Project” from “Templates”
Add the Objy PDD Wizard to the project
right-click project in “Solution Explorer”
select “Add” ► “New Item...”
select “Objy PDD Wizard” from “Templates”
Generate main
set “Class Name” and “NameSpace”
Choose your PDD file location
accept default values
Wizard generates C# main and persistence design files
Wizard adds Objectivity/DB assembly to the project
November 20, 2009 Michael Grossniklaus – Department of Computer Science – [email protected] 16
Persistence Designer
Schema is defined using the
persistence designer
Schema is updated in federation
by clicking “Update FD”
Domain classes and application
code is generated by clicking
“Update App”
for each class a pair of files is
generated, e.g. Author.cs and
AuthorPD.cs
AuthorPD.cs should not be modified
Author.cs can be used to add getter
and setters as well as derived
methods if required
delete
lock
After
... ...
} }
// Shutdown Objectivity/DB
Objy.Shutdown();
Transaction Cache
// Create a session
Session session = connection.CreateSession("main");
// Start a transaction
session.BeginTransaction(OpenMode.Update);
// Get the federation
Federation fd = session.Federation;
// Lookup or create the publications database
Database db;
if (fd.HasDatabase("PublicationsDB"))
{
db = fd.LookUpDatabase("PublicationsDB");
}
else
{
db = new Database(fd, "PublicationsDB");
}
...
session.CommitTransaction();
Objy.Shutdown();
// Update objects
moira.Name = "Moira C. Norrie";
icoodb.AddAuthor(moira);
icoodb.AddAuthor(michael);
// Access objects
Console.WriteLine("{0} is {1} years old.", michael.Name, michael.GetAge());
// Delete object
icoodb.Delete();
Scalable Non-Scalable
Ordered TreeListX<T>
TreeMapX<K,V>
TreeSetX<T>
Unordered HashMapX<T> Map<T>
HashSetX<T>
Scope names
Creating and following links
Individual and group lookup of persistent objects
through keys and iterators
Parallel query
Parallel Query Engine (Objectivity/PQE)
divides the query scope among a number of query servers
Content-based filtering
predicate-query language supporting primitive types and strings
used for predicate scans in group lookups
used when following a to-many relationship
used to find destination objects in parallel queries
Find all authors that are younger than 35 years of age and
that have authored a publication prior to the year 2000
ICollection<Publication> publications = from p in this.db.OfType<Publication>()
where p.Year < 2000
select p;
ICollection<Author> result =
from a in this.db.OfType<Author>()
where a.GetAge() < 35 &&
publications.Intersect(a.GetPublications()).Count() > 0
select a;
ICollection<Author> result =
this.db.Cast<Author>().Where(a => a.GetAge() < 35 &&
publications.Intersect(a.GetPublications()).Count() > 0);
Objectivity/DB
http://www.objectivity.com/