Table of Contents

OIL2 Class Standard.PersistentObject

class Standard . PersistentObject {
        int32   flags;
        oid     persistenceService;
        oid     registeredAs;
inherits from Object;


Class PersistentObject provides a generic facility that implements persistent objects. These capabilities are obtained by inheriting from this class and require almost no additional effort on the part of the application programmer.




Method Description

Null method.


PersistentObject:initialize(optional any qualifiedName, optional int32 optionalFlags)

Method Description

The optional argument qualifiedName can be used to permit the use of multiple PersistenceService databases. If no qualifiedName is specified, the PersistenceService object is located using the well-known service name /ObjectPager. The initialize method sends the persistent object services a makePersistent message. The object Id of the object PersistentObject is passed as the sole argument.

Normally, whenever a persistent object database is connected to a FARGOS/VISTA Object Management Environment, information about all of the previously stored persistent objects are important. Normally, the next step is for each of the saved objects to be restored into the currently active environment. A PersistentObject can override this behavior by providing an appropriate value for the optionalFlags argument.

always restore the object upon connection of the persistent object database. This is the default.
only restore the object when it is reference. This is the optimal behavior and should be used whenever feasible.
the object is actually a transient object and should be deleted rather than restored. This is used when paging out infrequently used objects

Return Value

Returns 0 upon success; otherwise -1.



Method Description

See initialize.



Method Description

A PersistentObject is always sent an objectImported message whenever it has been restored into the environment from the object database. This can be used by application classes to reestablish associations with services whose providers may have changed from the object was saved and restored.

Return Value

This method does not return a value.



Method Description

Reception of a disablePersistence message disables the persistent storage of a PersistentObject.



Method Description

Returns a two-element aray; subscript 0 holds the encoded object (obtained by Object:encodeObject) and subscript 1 holds a flag argument that indicates how the object should subsequently be restored.