[Progress Communities] [Progress OpenEdge ABL] Forum Post: Update a record with NO-LOCK status

Status
Not open for further replies.
P

Patrick Tingen

Guest
We just came across an odd situation. In one of our programs we FIND a record EXCLUSIVE and then run another program. In that program we FIND the record again, but now NO-LOCK and then update it. Yeah, I know. It's a bug in our code. But whaddayaguess? It just works. The record gets updated without any problem. Is this a bug or just Progress protecting me against myself? Below a test script against the sports db (or here on the ABL dojo). DEFINE BUFFER bCust FOR customer. FIND bCust NO-LOCK WHERE bCust.custNum = 1. MESSAGE bCust.name VIEW-AS ALERT-BOX. DO TRANSACTION: FIND bCust EXCLUSIVE-LOCK WHERE bCust.custNum = 1. RUN updateRecord. END. FIND bCust NO-LOCK WHERE bCust.custNum = 1. MESSAGE bCust.name VIEW-AS ALERT-BOX. PROCEDURE updateRecord: DEFINE BUFFER bCust FOR customer. FIND bCust NO-LOCK WHERE bCust.custNum = 1. ASSIGN bCust.name = 'Hello world ' + STRING(TIME). END.

Continue reading...
 
Status
Not open for further replies.
Top