4D v14.3

Locked

Home

 
4D v14.3
Locked

Locked 


 

Locked {( aTable )} -> Function result 
Parameter Type   Description
aTable  Table in Table to check for locked current record, or Default table, if omitted
Function result  Boolean in Record is locked (TRUE), or Record is unlocked (FALSE)

Locked tests whether or not the current record of aTable is locked. Use this function to find out whether or not the record is locked; then take appropriate action, such as giving the user the choice of waiting for the record to be free or skipping the operation.

If Locked returns TRUE, then the record cannot be saved because it is locked by another user or another process, or it is stacked in the current process. In this case, use LOAD RECORD to reload the record until Locked returns FALSE.

If Locked returns FALSE, then the record is unlocked, meaning that the record is locked for all other users. Only the local user or current process can modify and save the record. A table must be in read/write state in order for you to modify the record.

If you try to load a record that has been deleted, Locked continues to return TRUE. To avoid waiting for a record that does not exist anymore, use the LOCKED ATTRIBUTES command. If the record has been deleted, the LOCKED ATTRIBUTES command returns -1 in the process parameter.

Note: Locked returns False when there is no current record in table, in other words, when Record number returns -1.

During transaction processing, LOAD RECORD and Locked are often used to test record availability. If a record is locked, it is common to cancel the transaction.

 
PROPERTIES 

Product: 4D
Theme: Record Locking
Number: 147

 
HISTORY 

Created: < 4D v6

 
SEE ALSO 

LOAD RECORD
LOCKED ATTRIBUTES
Record Locking

 
ARTICLE USAGE

4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v11 SQL Release 6)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)