Hi Everybody,
many times on this forum i've found the construction like this:
DEF BUFFER b-cust for customer.
FOR EACH customer NO-LOCK:
FIND FIRST b-cust EXCLUSIVE-LOCK
WHERE ROW-ID(b-cust) = ROW-ID(customer).
b-cust.xyz = 'xyz'.
RELEASE b-cust.
END. /* for each customer */
My question is, what for Release statement after the buffer b-cust is updated? Why it is advisable by some Forum Speakers to put Release Statement after buffer b-cust is updated inside the transaction block? What would happen if i tried not to put Release statement after updating b-cust in this case? Doesn't transaction block for each.... make realease of b-cust automatically after the one for each iteration is done? Does it make sense to release one record inside the transaction since it cannot be released till the transaction is not finished? As far as im concerned Release makes the Trigger fires. But the Trigger would fire at the end of the record scope (and in this case at the end of the transaction scope) default by Progress. Wouldn't it?
Thanks in advance for any help.
many times on this forum i've found the construction like this:
DEF BUFFER b-cust for customer.
FOR EACH customer NO-LOCK:
FIND FIRST b-cust EXCLUSIVE-LOCK
WHERE ROW-ID(b-cust) = ROW-ID(customer).
b-cust.xyz = 'xyz'.
RELEASE b-cust.
END. /* for each customer */
My question is, what for Release statement after the buffer b-cust is updated? Why it is advisable by some Forum Speakers to put Release Statement after buffer b-cust is updated inside the transaction block? What would happen if i tried not to put Release statement after updating b-cust in this case? Doesn't transaction block for each.... make realease of b-cust automatically after the one for each iteration is done? Does it make sense to release one record inside the transaction since it cannot be released till the transaction is not finished? As far as im concerned Release makes the Trigger fires. But the Trigger would fire at the end of the record scope (and in this case at the end of the transaction scope) default by Progress. Wouldn't it?
Thanks in advance for any help.