Oberon ||
Library ||
Module Index ||
Search Engine ||
Definition ||
Module
Ulm's Oberon Library:
PersistentNodes
NAME
PersistentNodes - persistent hierarchy of nodes
SYNOPSIS
CONST dbfailure = 0;
CONST dbinconsistent = 1;
CONST transfailure = 2;
CONST noroot = 3;
CONST linkwithoutparent = 4;
CONST nonunique = 5;
CONST badlink = 6;
CONST errors = 7;
TYPE ErrorCode = SHORTINT; (* dbfailure ... *)
TYPE ErrorEvent = POINTER TO ErrorEventRec;
TYPE ErrorEventRec =
RECORD
(Events.EventRec)
errorcode: ErrorCode;
END;
VAR errormsg: ARRAY errors OF Events.Message;
VAR error: Events.EventType;
PROCEDURE Init(container: Containers.Container;
permissions: Names.Permissions) : BOOLEAN;
PROCEDURE Open(VAR root: Names.Node;
container: Containers.Container) : BOOLEAN;
DESCRIPTION
PersistentNodes
provides an implementation of Names where the
nodes remain persistent thanks to a persistent container.
All capabilities of Names are supported. Some notes
regarding this implementation:
- Names.Insert
accepts nodes from other implementations or other containers.
However, these connections are not persistent and are lost
as soon as the container is re-opened. RobustObjects
is recommended to let such objects reappear automatically
as soon as the persistent nodes reappear.
- Names.Destroy
does not permit the root object to be destroyed. This is
rejected independent from the configured Shards pot
for the Names.destroy access mode. In case of an attempt
to destroy a node by terminating it using Resources.Notify,
all subsequent operations on any persistent node from the same container
will fail until the container is re-opened again.
- Nodes that become unreachable by Names.Delete or
Names.Destroy operations will be garbage collected by the
next Open operation.
Init
prepares a container for subsequent use of this module.
This causes all present objects in the container to be deleted
and an empty root node to be inserted with the given
set of access permissions.
Open
opens container and, if successful, makes its
root node available. Some notes:
- Containers that are passed to Open are for exclusive
use of PersistentNodes only.
- PersistentNodes maintains a transaction
(see ObjectTransactions) for each opened container which
does not permit any operations on container in parallel.
- All nodes that are retrieved
from the container terminate as soon as the container terminates.
DIAGNOSTICS
PersistentNodes
generates various standard error events of Names
and following in addition:
- dbfailure
-
an operation on the underlying container failed.
- dbinconsistent
-
inconsistencies were found by Open within the
container
- transfailure
-
the transaction object of ObjectTransactions
which is used for the container generated an error
- noroot
-
no root object was found within the container
(special case of a database inconsistency)
- linkwithoutparent
-
a link without a valid parent node was found within the container
(special case of a database inconsistency)
- nonunique
-
two links shared the same name and belonged to the same parent node
(special case of a database inconsistency)
- badlink
-
a link with an invalid reference was found within the container
(special case of a database inconsistency)
SEE ALSO
- Containers
-
abstraction for persistent object databases
- Names
-
Oberon name spaces
- Shards
-
general abstraction for authorizations
Edited by: borchert, last change: 2004/06/25, revision: 1.2, converted to HTML: 2004/06/25
Oberon ||
Library ||
Module Index ||
Search Engine ||
Definition ||
Module