Consultor Eletrônico



Kbase P23931: 4GL/ABL: LOCKED function returns TRUE after a FIND EXCLUSIVE-LOCK NO-WAIT NO-ERROR.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   27/01/2010
Status: Verified

SYMPTOM(s):

4GL/ABL: LOCKED function returns TRUE after a FIND EXCLUSIVE-LOCK NO-WAIT NO-ERROR.

<file-name> in use by <user> on <tty>. Wait or choose CANCEL to stop. (2624)

The AVAILABLE function returns FALSE after the FIND.

The FIND statement is fetching a non-existing record and is using a non-indexed field.

Another user has an EXCLUSIVE-LOCK on one or more records of the same table.

FACT(s) (Environment):

All Supported Operating Systems
Progress 8.x
Progress 9.x
OpenEdge 10.x

CAUSE:

Because the FIND statement is using a non-indexed field to find a non-existing record with an EXCLUSIVE-LOCK, Progress attempts to hold every record it reads with an EXCLUSIVE-LOCK while searching for the target record. But since the record does not exist, Progress ends up attempting to FIND all the records of the table EXCLUSIVE-LOCK and since one or more of these records are being held EXCLUSIVE-LOCK by another user the LOCKED function returns TRUE.

FIX:

1. Avoid using a non-indexed FIND with EXCLUSIVE-LOCK or SHARE-LOCK.
2. When a non-indexed FIND is necessary, use the NO-LOCK option to fetch the record.
3. Upgrade the lock to an EXCLUSIVE-LOCK after the record is found using the FIND CURRENT statement.