F
Francisco Morales López
Guest
The result is the expected, because the transaction is oriented on the first buffer not on the second, even when they are called equal, they occupy two different references in memory. If you want to keep the transaction you must not generate a new buffer, nor perform the no-lock search. DEFINE BUFFER bCust FOR customer. (this is a buffer1) 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: (This process could update the record as long as it is not another pointer.) DEFINE BUFFER bCust FOR customer. (This is a buffer2) FIND bCust NO-LOCK WHERE bCust.custNum = 1. (This is the same record but not the same pointer, this pointer is in no-lock mode) ASSIGN bCust.name = 'Hello world ' + STRING(TIME). END.
Continue reading...
Continue reading...