Salesforce

Exclusive lock on record is held beyond the end of the transaction scope

« Go Back

Information

 
TitleExclusive lock on record is held beyond the end of the transaction scope
URL NameP36510
Article Number000171929
EnvironmentProduct: Progress
Version: 8.x, 9.x
Product: OpenEdge
Version: 10.0A
OS: All supported platforms
Question/Problem Description
Exclusive lock on record is held beyond the end of the transaction scope
Using FOR FIRST <buffer> EXCLUSIVE-LOCK
Referring to buffer after the FOR FIRST block
Steps to Reproduce
Clarifying Information
Example code:

FOR FIRST Customer EXCLUSIVE-LOCK TRANSACTION:
    LEAVE.
END.

FIND FIRST _Lock WHERE _Lock-Recid = INTEGER(RECID(Customer)) NO-ERROR.

DISPLAY _Lock-Flags Transaction.

In this code, the RECID() function refers to the buffer, thus pushing the record scope beyond the transaction scope.
The DISPLAY statement above will display and 'X' for the _Lock-Flags which indicates that the record still has an exclusive lock.
Note that in many cases, one would expect the lock to be dropped entirely after the FOR FIRST block.
This will not happen automatically, but can be forced by a FIND CURRENT <buffer> NO-LOCK immediately after the block.
Error Message
Defect NumberDefect PSC00144967 / OE00096038
Enhancement Number
Cause
The exact cause is not known at this time.
Resolution
Upgrade to OpenEdge 10.0B or later.
 In the later releases the record lock is properly downgraded to share-lock.
Workaround
Notes


References to written documentation:

Progress Articles:
How Transactions work in Progress
Keyword Phrase
Last Modified Date2/18/2021 8:28 PM

Powered by