Consultor Eletrônico



Kbase P168026: 4GL/ABL: Unexpected lock types
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   6/15/2010
Status: Unverified

SYMPTOM(s):

4GL/ABL: Unexpected lock types

Running the following code:


FOR FIRST customer EXCLUSIVE-LOCK:
END.
MESSAGE AVAILABLE(customer)
VIEW-AS ALERT-BOX INFO BUTTONS OK.
FOR EACH _lock NO-LOCK:
IF _Lock-Table = ? OR _Lock-Recid = ? THEN LEAVE.
MESSAGE _lock-Flags
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.

using a remote client connection returns an unexpected EXCLUSIVE-LOCK flag (X).

Running the following code:


DO FOR Customer:
FOR FIRST customer EXCLUSIVE-LOCK:
END.

MESSAGE AVAILABLE(customer)
VIEW-AS ALERT-BOX INFO BUTTONS OK.

FOR EACH _lock NO-LOCK:
IF _Lock-Table = ? OR _Lock-Recid = ? THEN LEAVE.
MESSAGE _lock-Flags
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.
END.

using either a remote client connection or a shared memory connection returns an unexpected EXCLUSIVE-LOCK flag (X).

FACT(s) (Environment):

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

CAUSE:


The state of a record buffer is undefined after exiting a FOR block. Depending on whether the FOR block is a FOR FIRST, LAST, EACH, RECID or sorted or BREAK BY, the lock can be downgraded differently and in many cases, the record may not even be available. Another factor that may determine the lock type of the buffer after exiting a FOR block is whether the client ? server connection is a remote or a local shared memory connection. Local shared memory clients block on a record lock, while remote clients depend on the server to manage locking and the server cannot block because it has to service other clients in order to resolve the lock.

FIX:

Use the FIND-CURRENT statement to get the lock type desired.