Changes the lock mode of a record in a buffer.
Return type: LOGICAL
Applies to: Buffer object handle
The default is to wait.
The following shows an example of the FIND-CURRENT method:
DEFINE VARIABLE bh AS HANDLE NO-UNDO. bh = BUFFER Customer:HANDLE. DO TRANSACTION: bh:FIND-CURRENT(EXCLUSIVE-LOCK). END. MESSAGE bh:CURRENT-CHANGED Customer.CustNum. |
If the change in lock status succeeds, the method returns TRUE, otherwise it returns FALSE.
If the lock change fails, a message displays. You can suppress the message using NO-ERROR on the statement containing the method.
Executing the FIND-CURRENT method resets the CURRENT-CHANGED attribute. If the record in the database changes between the time the original record was found and the FIND-CURRENT executes, the CURRENT-CHANGED attribute returns TRUE. If the record does not change, then the CURRENT-CHANGED attribute returns FALSE.