|
Objectivity for Java Reference | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.objy.db.app.ooAbstractObj | +--com.objy.db.app.ooObj | +--com.objy.db.app.ooContObj | +--com.objy.db.app.ooGCContObj
Represents a garbage-collectible container.
A garbage-collectible container allows you to store directed graphs of objects, and work with the graph much as you would with an object graph in the memory of a Java application. In Java, when an object is no longer referenced from any other object, it is subject to garbage collection. In the database, the individual objects in a graph can be linked together by relationships, by references in persistent fields, or by both relationships and references. At least one object in each directed graph must be a named root. As long as all objects in the graph are stored in garbage-collectible containers, you need not delete objects that cease to be part of the graph. In a federated database, unlike Java memory, garbage collection does not occur automatically. Instead, you must use the oogc administration tool when you want to delete unreferenced objects. For additional information about garbage collection, and guidelines on when to use garbage-collectible containers, see Selecting the Correct Container Type.
When you call new to create a container object, the newly created container is transient. During a transaction, you can make the container persistent by adding it to a database. To add a container to a particular database, you call the addContainer method of the instance of ooDBObj that represents the database. For additional details, see Creating a Container.
You can obtain an object representing an existing garbage-collectible container from an object in the container, by looking up its system name, or from an iterator that finds all containers in a database. For more information, see Retrieving an Existing Container.
Note: A garbage-collectible container object belongs to the session that is in a transaction when the container is made persistent or retrieved. Objectivity for Java does not allow a garbage-collectible container to interact with objects that belong to different sessions; see Object Isolation.
If you want to save container-specific information in a database, you can use containers of an application-specific container class instead of instances of ooGCContObj. To define your own garbage-collectible container class, subclass ooGCContObj and define persistent fields to represent the container-specific information. See Defining Persistence-Capable Classes.
Constructor Summary | |
ooGCContObj()
Constructs a garbage-collectible container. |
Methods inherited from class com.objy.db.app.ooContObj |
addIndex, addUniqueIndex, cluster, contains, convertObjects, copy, delete, deleteNoProp, dropIndex, flush, getContainer, getControlledBy, getDB, getGrowthFactor, getHash, getName, getOid, getPageCount, hasIndex, isUpdated, lockNoProp, move, refresh, releaseReadLock, returnControl, scan, scan, scan, transferControl |
Methods inherited from class com.objy.db.app.ooObj |
activate, clearModified, deactivate, deleteReference, dropCachedReference, fetch, fetch, getPersistor, getSession, isDead, isFetchRequired, isModified, isPersistent, isValid, lock, lookupObj, lookupObj, lookupObjName, markFetchRequired, markModified, nameObj, persistor, preWrite, scopedBy, scopedObjects, setPersistor, unnameObj, updateIndexes, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ooGCContObj()
The newly created container object is transient; to make it persistent, you must add it to a database by calling the addContainer method of the database.
|
Objectivity for Java Reference | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2000 Objectivity, Inc. All rights reserved.