Have a Question?

00043: An introduction to advisory locking


An introduction to advisory locking


Advisory locking is for those applications that use correct locking techniques to maintain databases. It is not correct to simply enable advisory locking and hope that the application correctly locks data files; it is necessary to test the application for suitability before enabling advisory locking. 

Advisory locking expects that any data read for modification is locked from another user’s access using the EXTRACT verb. In a non-advisory locking environment, the EXTRACT verb locks the read data from any other operation that would access the data. In the advisory locking environment, the data is locked from further locking in the assumption that the data would be locked prior to any modification. 

In a non-advisory locking environment, an EXTRACT blocks the following operations: EXTRACT, READ, WRITE, and REMOVE. In an advisory locking environment, the EXTRACT blocks only EXTRACT and REMOVE; the WRITE may be blocked in some environments. 

At the minimum, advisory locking allows you to enhance your application by allowing simple inquiries to data to “ignore” the locks placed on the data as long as the data isn’t being modified. This capability is used by BBx by setting the $000040$ bit in the OPTS vector. If this bit won’t stay set, then BBx cannot support advisory locking. 

Advisory Locking at the System Level 

In addition to allowing an application to read locked data, you may tell BBx that the locks on your system are truly advisory–this means that anyone may read data locked as the operating system doesn’t compare reads against locks, but only compares the locks against one another. As this is a “feature” of operating systems, BBx doesn’t expect this capability but is willing to use it if told to do so. To tell BBx that the host operating system uses advisory locking, set the OPTS bit $000010$. 

Key Area Read Locking 

If your system supports multiple owners of a lock (using a non-exclusive or read permitting form), you may inform BBx to use it in reading the key area of a file using the OPTS bit $000020$. This will permit more than one BBx process to read the key area of a file at a time. The offset of this advantage is that allowing multiple readers into the key area may end up preventing a single writer access to the key area. This can occur in times of high system load or, in some installations, enough of the time to cause objectionable performance for those tasks attempting to write or to remove keys from the file. 

Last Modified: 12/18/1997 Product: PRO/5 Operating System: Unix Novell

BASIS structures five components of their technology into the BBx Generations.

Table of Contents
Scroll to Top