13.07.2015 Views

Operational Differences - InterSystems Documentation

Operational Differences - InterSystems Documentation

Operational Differences - InterSystems Documentation

SHOW MORE
SHOW LESS
  • No tags were found...

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

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

Locking Behavior• AUX• CLOCK$• NUL3.2 Locking BehaviorCaché associates locks with the file variable. This differs from most MultiValue implementations(except Unidata) which associate the lock with the file.For example, consider the following sequence of events:1. A main program opens a file and locks a record in it.2. The main program calls a subroutine, passing the file name but not the file variable.3. The subroutine uses the name to open the file using a local file variable, locks the same record inthe file, performs some calculation, releases the lock, and returns to its caller.When the subroutine returns control to the main program, the lock set by the main program is still inforce. It is associated with the file variable in the main program.In this sequence, however:1. A main program opens a file.2. The main program calls a subroutine, passing the file variable as an argument.3. The subroutine uses the file variable argument to lock a record in the file, performs some calculation,and returns to its caller.When control returns to the main program, the lock set by the subroutine is still in effect because it isassociated with the file variable passed as the argument.Note:The same principle applies to a single program which opens the same file multiple timesusing different file variables. Lock operations using one file variable do not affect locks takenusing a different file variable. Thus, when a program locks the same item through two differentfile pointers, the second lock isn't blocked, because it is taken by the same process. (SomeMultiValue implementations DO block such a lock.) However, each lock must be separatelyreleased.<strong>Operational</strong> <strong>Differences</strong> between MultiValue and Caché 11

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

Saved successfully!

Ooh no, something went wrong!