If there is no reason to rad the file in a specific sequence then RRN could be used an on detecting a lock advance to the next RRN. I don't know enough about the requirement to know if there would have to be a log of those skipped records so that you could loop back and retry later.

There is also the option not to hold the lock until ready to update the record (i.e. the web service data has ben received). initial read would be with the (N) extender - store the image and then once the web service responds re-read the record with a lock and check to make sure no other updates have occurred since the original read. The processing requirement st that point only the OP knows.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Oct 18, 2018, at 6:28 AM, Buck Calabro <kc2hiz@xxxxxxxxx> wrote:

On Thu, 18 Oct 2018 at 01:14, Roger Harman <roger.harman@xxxxxxxxxxx> wrote:

Another process trying to read that record will wait until the timeout (WAITRCD value on the file) and then throw a message. Of course, you can monitor for that in the program.

Amplifying Roger's comment, I don't believe there is a 'read next
unlocked' operation in RPG RLA. Essentially, the proposed design would
do a READ and if the record is locked by a different process, the
program will get a read timeout exception. The program can, of course,
trap that error, but I don't see how the program can get past it -
issuing another READ will attempt to read the same, locked, record. If
all the processes READ using the same access path, the second one must
necessarily attempt to read an 'in use' record.

The last time I did this, I added a column to the table that indicated
if the row was 'in work'. Build a LF that omits these rows, and READ
through the LF. The program only sees rows that are available. The
first step is to set the 'in work' column.
--buck
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD


This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].