11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Caché</strong> <strong>ObjectScript</strong> CommandsLOCK Without an ArgumentThe argumentless LOCK removes all locks currently held by the process. This includes bothsimple and incremental locks. It also includes all accumulated incremental locks. For example,if there are three incremental locks on a given lock name, <strong>Caché</strong> removes all three locks andresets the lock name's entry in the lock table to zero. Argumentless LOCK removes bothshared and exclusive locks.Argumentless LOCK is used to explicitly release all existing locks. Completion of a processalso releases all locks held by that process. Completion of a transaction releases all locks heldwithin that transaction.LOCK With an ArgumentLOCK with an argument specifies one or more lock names on which to perform locking andunlocking operations. The effect of the LOCK depends on the argument you use.• LOCK lockname sets a simple lock on the specified lock name and unlocks all previouslocks.• LOCK +lockname sets an incremental lock on the specified lock name.• LOCK -lockname performs an unlock operation. Unlocking decrements a lock countfor the specified lock name; when this lock count decrements to zero, the lock is unlocked.You can specify multiple locks with a single LOCK command in either of two ways:• By enclosing a comma-separated list of lock names in parentheses, you can perform theselocking operations on multiple locks as a single operation. For example:LOCK +(var1,var2):10All lock operations in a parentheses-enclosed list are governed by a single timeout argument:either all of the locks are applied or none of them are applied.• By specifying multiple lock arguments without parentheses as a comma-separated list,you can specify multiple independent lock operations, each of which can have its owntimeout. (This is functionally identical to specifying a separate LOCK command for eachlock.) For example, a single LOCK command could perform a simple lock and anincremental lock, each with its own timeout:LOCK var1:10,+var2:15However, if you use multiple lock arguments, be aware that the simple lock operationunlocks all prior locks, including locks set by an earlier part of the same LOCK command.80 <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!