I needed this for our billing process that processes massive amount of data.
It is a multi threaded process. Each thread processes customer that is next
in line to be billed. We've encountered problem with each thread
encountering record lock with each other. Now, it theory, that is not
possible because each thread processes different set of customer info. But
remember this little note about READE from the RPG reference manual:
Note: If a file is defined as update and the N operation extender is not
specified, occasionally a READE operation will be forced to wait for a
temporary record lock for a record whose key value does not match the
search argument. Once the temporary lock has been obtained, if the key
value does not match the search argument, the temporary lock is released.
Yeah, above is what is causing each thread to encounter record lock with
each other. So, we now need to change all the READE to READE(n) and then
lock for update if necessary. We need to do this to all programs that are
being called in this billing process.
"Florin Todor - YYZ Concord" wrote in message
news:mailman.561.1330702890.14575.rpg400-l@xxxxxxxxxxxx...
Why don't you reed it with lock first and if you don't need to update
it, unlock it?
Thank you
Florin Todor
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Hockchai Lim
Sent: Friday, March 02, 2012 10:13 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re-READ the current record
Is there a way to re-READ the current record (without using CHAIN) that
the
RPG program has just READ?
For example:
reade(n) (mykey1) MYFILE; //read it with no lock
if not %eof() and needUpdated();
==> Need to re-read with locked how???
endif;
As an Amazon Associate we earn from qualifying purchases.