Module Index ||
Search Engine ||
Ulm's Oberon Library:
ObjectTransactions - transactions which involve one object only
TYPE Object = Services.Object;
TYPE BeginProc = PROCEDURE (object: Object;
trans: Transactions.Transaction) : BOOLEAN;
TYPE TransProc = PROCEDURE (object: Object) : BOOLEAN;
TYPE Interface = POINTER TO InterfaceRec;
TYPE InterfaceRec =
commit, abort, release: TransProc;
CONST notSupported = 0;
CONST oneObjectOnly = 1;
CONST alreadyAttached = 2;
CONST authorizationFailed = 3;
CONST invalidTransition = 4;
CONST noObjectAttached = 5;
CONST transReleased = 6;
CONST errors = 7;
TYPE ErrorCode = SHORTINT; (* notSupported..transReleased *)
TYPE ErrorEvent = POINTER TO ErrorEventRec;
TYPE ErrorEventRec =
VAR error: Events.EventType;
VAR errormsg: ARRAY errors OF Events.Message;
(* implementors side *)
PROCEDURE Register(type: Services.Type; if: Interface);
(* client side *)
PROCEDURE Supported(object: Object) : BOOLEAN;
PROCEDURE Create(VAR trans: Transactions.Transaction;
object: Object; pot: Shards.Pot;
errors: RelatedEvents.Object) : BOOLEAN;
is a trivial implementation of Transactions
which interfaces those objects which do not support distributed
Supporting a Type for ObjectTransactions
Implementors which offer transactions for one specific kind
of objects only have to register themselves at initialization time
by calling Register.
The given interface if is a great simplification in
comparison to that of Transactions and is expected to
meet following specifications:
- begin: PROCEDURE(object: Object; trans: Transactions.Transaction);
Begin a transaction in the sense of Transactions
Note that ObjectTransactions guarantees that the transaction
is neither already running nor released.
FALSE is to be returned if the implementation is for
other reasons unable to start a transaction.
Those operations of object which have a
transaction parameter (e.g. implementations of Containers)
should check it against trans
and fail if it does not match.
- commit: PROCEDURE(object: Object);
Commit the running transaction for object.
In case of failures, FALSE is to be returned and the
transaction is considered as aborted, then.
- abort: PROCEDURE(object: Object);
Abort the running transaction for object.
FALSE may be returned in case of problems --
but the transaction is to be considered aborted
afterwards independent from the return value, though.
- release: PROCEDURE(object: Object);
Final operation on a transaction object which
should cause all resources to be released.
allows to check whether an object supports the interface of
this module or not.
creates a transaction in the sense of Transactions
with object attached (if non-NIL) which is
protected by pot (which may be NIL if the
transaction should run unprotected).
If object was not given initially,
one and only one supported object may be attached later by
Note that objects supported by ObjectTransactions
are not allowed to participate in more than one transaction
All operations of Transactions with the exception
of Transactions.GetName may be applied later under
the restriction that just one object may be attached to it.
Termination of Transactions
- Released transactions will terminate.
- If a transaction becomes Resources.unreferenced
or Resources.terminated, it will be released
automatically (if this has not been done already).
This includes an implicit abortion if the transaction was active.
- The termination of transaction objects is propagated
to the associated transaction.
Note that terminations by means of Resources.Notify
may bypass the authorization which is needed for
Transactions.Release. This works, however,
only if there are no filter objects involved
because proxy termination is (usually)
not propagated to the original object
(see, for example, RemoteObjects).
All operations return FALSE in error cases
and generate appropriate error events in addition to those
generated by underlying levels.
Following error events may be generated by ObjectTransactions:
The given object has no support for this module,
i.e. nobody has called Register for its type or one
of its base types.
Transactions created by ObjectTransactions accept one
supported object only.
Parallel transactions on one object are not supported.
This error gets raised if the given lid auth does
not match the pot which has been passed to Create.
ObjectTransactions checks all state transitions for
validity, e.g. an aborted transaction must not be committed, or
a not yet begun transaction cannot be aborted.
ObjectTransactions does not allow transactions to
be started as long there is no object attached to it.
None of the operations must be called after a
transaction has been released.
termination of objects
general abstraction of distributed transactions for
which ObjectTransactions offers a trivial implementation
transaction streams support ObjectTransactions
Edited by: borchert, last change: 1996/11/28, revision: 1.2, converted to HTML: 1997/04/28
Module Index ||
Search Engine ||