|
The Unlock operation (B_UNLOCK) unlocks one or more records that have been locked explicitly (that is, the records were locked using a lock bias of +100, +200, +300, or +400). The Unlock operation releases locks held by the specified position block; therefore, if you have the same file opened more than once, you must issue an Unlock for each position block before the record is completely unlocked. Similarly, each client that holds a lock on records in the file must issue an Unlock before the record is completely unlocked.
You must have at least one record lock.
To unlock a single-record lock, follow these steps:
To unlock a record locked by a multiple-record lock, first retrieve the 4-byte position of the record to unlock by issuing a Get Position operation (22) for that record. Then, issue the Unlock operation as follows:
To unlock all the multiple record locks on a file, follow these steps:
If the Unlock operation is successful, the transactional interface releases all the locks that the operation specified.
If the Unlock operation is unsuccessful, the transactional interface returns a nonzero status code-most likely, Status Code 81.
The Unlock operation has no effect on positioning.
|
Chapter contents
Prev topic: Stop (25)
|