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.

• Incremental locking adds new locks without removing existing locks. It leaves unchangedthe processes' existing locks, unless those lock names are specified in the incrementalLOCK command. This gives you more explicit control over locking than available withsimple locking, permitting you to add locks without releasing existing locks.• If a specified lock name was previously unlocked, it is locked and assigned a lock countof 1. This is identical to a simple lock.• If a specified lock name was previously locked (by either a simple lock or an incrementallock), the lock continues in effect and the lock count is incremented by 1.Lock counts are assigned in the locking table as either Exclusive or Shared, depending onthe lock type used.The following example sets an incremental lock on lock names ^x and ^y.LOCK +(^x,^y)The enclosing parentheses are required when specifying multiple lock names.UnlockingThe following example removes an exclusive lock from lock name ^a.LOCK -^aIf the lock count for ^a is 1, the lock is unlocked (removed from the lock table.) This can beeither a simple lock, or an incremental lock with a lock count of 1. If the lock count for ^a isgreater than 1, the lock count is decremented.Note that only the Exclusive lock count and lock are affected, not the Shared lock count andlock. The same lock name can have both an Exclusive and a Shared lock. The followingexample removes a shared lock from lock name ^a:LOCK -^a#"S"The following example performs unlocking on lock names ^a, ^b, ^c, ^d, and ^e.LOCK ^aLOCK +(^b)LOCK +(^b,^e,^e#"S")LOCK +(^c#"S",^d#"S")LOCK -(^a,^b,^c#"S",^d,^e)The unlock command in this example does the following:• ^a is unlocked and removed from the lock table. ^a had an exclusive lock count of 1.• ^b remains in the lock table, but its exclusive lock count is decremented from 2 to 1.LOCK<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 85

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

Saved successfully!

Ooh no, something went wrong!