11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Caché</strong> <strong>ObjectScript</strong> CommandslocknameThe name of a single data resource, or a comma-separated list of data resources, to be lockedor unlocked. A lockname is a name representing a data resource; it is not the variable itself.That is, your program can use a lock named "a" and a variable named "a" without conflict.Lock names are case sensitive. In <strong>Caché</strong>, the following are all valid and unique lock names:a, A, ^a, ^A, ab. Lock names follow the same naming conventions as local variables andglobal variables, as described in the Variables chapter of Using <strong>Caché</strong> <strong>ObjectScript</strong>.Note:Process-private global names should not be used as lock names.Lock names can be local or global. A lock name such as A is a local lock name. It appliesonly to that machine, but does apply across namespaces. A conflict occurs when twonamespaces attempt to lock the same lock name. A lock name that begins with a caret (^)character is a global lock name; the mapping for this lock follows the same mapping as thecorresponding global, and thus can apply across systems. (See Global Structure in Using<strong>Caché</strong> Multi-Dimensional Storage.)A lock name can represent a local or global variable, subscripted or unsubscripted. It can bean implicit global reference, or an extended reference to a global on another computer. (SeeGlobal Structure in Using <strong>Caché</strong> Multi-Dimensional Storage.)The reference for a lock name does not need to exist. For example, your applications maylock the lock name "ACCT" to mean, by convention, that other routines may not accessglobals in the database in the namespace "ACCTING".locktypeThe type of lock to apply or remove. You can specify a different lock type for each lockname. locktype is an optional argument; if omitted, the lock name defaults to an exclusivelock. The syntax for lock type is a mandatory pound sign (#), followed by one or more locktypes enclosed in quotation marks. Lock type codes can be specified in any order and are notcase sensitive. The following are the lock type codes:• S: Shared lockAllows multiple processes to simultaneously hold nonconflicting locks on the sameresource. For example, two (or more) processes may simultaneously hold shared lockson the same resource, but an exclusive lock limits the resource to one process. An existingshared lock prevents all other processes from setting an exclusive lock, and an existingexclusive lock prevents all other processes from setting a shared lock on that resource.However, a process can first set a shared lock on a resource and then the same processcan set an exclusive lock on the resource, upgrading the lock from shared to exclusive.82 <strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!