VALID(OC)

Shore Programmer's Manual - 3 November 94

NAME

valid \- determine validity of a reference to a Shore object

SYNOPSIS

#include <ShoreApp.h>
shrc REF(T)::valid(LockMode lm = SH) const;

DESCRIPTION

The valid method indicates whether the given ref can be followed safely. In this context, "safe" means that there is an object at the other end of the ref, and that the object can be locked in the indicated lock mode. This method will obtain the lock, but will not fetch the object into the object cache. The fetch method can be used for this purpose.

RETURN VALUE

A return code of RCOK indicates that the lock was successfully obtained, and that the ref is therefore valid. Any other error code indicates either that the ref is not valid, or that the lock could not be obtained (perhaps due to insufficient permission on the part of the process).

BUGS

Because this method obtains a lock on the object, it may be forced to wait, in another transaction holds a conflicting lock on the object.

It is legal, and potentially useful, to pass a lock mode of NL (no lock) to valid. However, if no lock is obtained, then nothing prevents another transaction from destroying the referenced object, thereby invalidating the ref, before the end of the current transaction.

VERSION

This manual page applies to Version 0.1 of theShore software.

SPONSORSHIP

The Shore project is sponsored by the Advanced Research Project Agency, ARPA order number 018 (formerly 8230), monitored by the U.S. Army Research Laboratory under contract DAAB07-91-C-Q518.

COPYRIGHT

Copyright (c) 1994 Computer Sciences Department, University of Wisconsin -- Madison. All Rights Reserved.

SEE ALSO

ref(oc) , fetch(oc) .