The basic operations of the persistent store are as follows:
- create, openRead, openWrite are used for creating and opening a persistent store in order to access its contents. The name parameter is interpreted as a pathname relative to the current working directory of the process. When opening a persistent store for reading, it is not possible to update the contents of the persistent store, although the objects fetched may be changed in memory.
- put points out an object to become a persistent root. This does not affect the contents of the persistent store, but registers the object is be saved in future checkpoint operations. At the same time the object is given a textual name to be used in get operations.
- get retrieves an object identified by its textual name from secondary storage. If the object is already in memory, a pointer to the in-memory version is returned without changing the state of the object.
- checkpoint saves the state of persistent objects on secondary storage. The transitive closures of all persistent roots in process memory are traversed, and all the objects saved. Checkpoint has no effect on stores opened by openRead.
- close closes the persistent store. By default close performs a checkpoint operation before closing the files making up the persistent store. In most uses of the persistent store, it is therefore not necessary to call checkpoint explicitly.
Other operations on persistent stores are supported. These operations are described in section 4 on advanced features. In addition to the persistentstore operations, the deletePersistentStore pattern is available for deleting a persistent store.
A simple example using the persistentstore pattern is shown in section 3.3.
Persistence in BETA - Reference Manual |
© 1991-2002 Mjølner Informatics |
[Modified: Monday October 23rd 2000 at 10:43]
|