ObjectStore Java API User Guide

Glossary

active persistent object

An active persistent object starts as an exact copy of the object that it represents in the database. ObjectStore initializes a hollow object so that it becomes an active object. This happens when an application calls the ObjectStore.fetch() or ObjectStore.dirty() method. If an application calls the ObjectStore.dirty() method (as opposed to the ObjectStore.fetch() method) on a hollow object, the resulting active object can be modified.

Consequently, an active object is not necessarily identical to the object in the database that it represents. An application can read or update an active persistent object; a persistent object must be active for an application to read or update it.

batch

A batch is a set of files that must be postprocessed together. Often, this is all the files in your application. In more complex applications, there might be multiple batches that each contain a library and a batch of files that you write, which reference the libraries.

database

Persistent storage is organized into databases. Before a persistent object can be created, the database in which it is to be stored must exist, and this database must be opened by the process performing the creation. The database must also be opened by any processes accessing the object. A single application can open several databases at once. A single database can be accessed by many applications at once.

deadlock

A simple deadlock occurs when one transaction holds a lock on a data item that another transaction is waiting to access, while at the same time the second transaction holds a lock on a data item that the first transaction is waiting to access. Neither process can proceed until the other does. ObjectStore detects and breaks deadlocks by aborting one of the transactions involved.

hollow persistent object

A hollow persistent object contains fields that are identical to the fields of the object in the database that the persistent object represents, but the fields have default values.

persistence-aware

If the methods of a class can operate on persistent objects but an instance of the class cannot itself be stored in a database, the class is persistence-aware.

When a method accesses fields in a persistent object, ObjectStore checks to ensure that the data has been read from the database. This checking is done by calls to the ObjectStore.fetch() andObjectStore.dirty() methods. A persistence-aware class includes the annotations that call the fetch() and dirty() methods. It does not include the other annotations required for a class to be persistence-capable. Normally, you run the class file postprocessor to annotate a class so that it is persistence-aware. Occasionally, you manually annotate the class yourself.

persistence-capable

A persistence-capable object has the capacity to be stored in a database. If you can store the instances of a class in a database, the class is persistence-capable and the instances of the class are persistence-capable objects.

The definition of a persistence-capable class includes specific annotations required by ObjectStore. After you compile class definitions, you run the ObjectStore class file postprocessor on the compiled classes to add the annotations that make the classes persistence-capable.

Some Java-supplied classes are persistence-capable. Others are not persistence-capable and cannot be made persistence-capable. A third category of classes can be made persistence-capable, but there are important issues to consider when you do so. Be sure to read Java-Supplied Persistence-Capable Classes.

persistent object

A persistent object is a representation of an object that is stored in a database.

After an application retrieves an object from the database, the application works with the persistent object in the Java environment. A persistent object always exists in one of three states:

session

A session allows the use of the ObjectStore API. ObjectStore uses the abstract COM.odi.Session class to represent sessions.

Your application must create a session. After a session is created, it is an active session. A session remains active until your application or ObjectStore terminates it. After a session is terminated, it is never used again. You can, however, create a new session.

A session consists of a set of persistent objects, and a set of ObjectStore API objects, such as a Transaction, Databases, and Segments.

In a single Java VM,

If you are using PSE or ObjectStore, separate Java virtual machines can each run their own session at the same time. If you are using PSE Pro, separate Java virtual machines can each run multiple sessions at the same time. See How Sessions Keep Threads Organized.

stale persistent object

A stale persistent object is no longer valid. Its fields have default values and it should not be used.

A persistent object might become stale after an application commits or aborts a transaction in which the active or hollow persistent object was accessible. When an application calls the ObjectStore.destroy() method, the target of the destroy method becomes stale.

An application must not try to read or update a stale object.

transitive persistence

When an application commits a transaction, it stores in the database any transient objects that can be transitively reached from any persistent objects. This is the process of transitive persistence.



[previous] [next]

Copyright © 1998 Object Design, Inc. All rights reserved.

Updated: 10/07/98 05:11:11