|
On Nov 2, 2023, at 11:04 AM, Dan <dan27649@xxxxxxxxx> wrote:
I'm not sure I follow the purpose of "granularity" in this scenario. Are
you advocating for the WAITRCD(800) override to replace the existing
looping logic? The two advantages I see are that 1) the looping logic is
eliminated and, 2) the 20 second "sleep" time is eliminated, allowing
processing to continue as soon as the record is unlocked by the other job.
If the lock still exists after WAITRCD(800) expires, I'd still process the
error.
- Dan
On Wed, Nov 1, 2023 at 5:36 PM Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:
I can only think that you get more granularity of control with a wait. I--
would use the sleep() or usleep() functions rather than wasting machine
respource on a loop.
In the past, I used this approach when the norm was a small delay for the
lock but we would increase the wait time on each iteration until a sanity
limit was reached at which point we worked out who had the lock and shouted
at them!
Jon P
On Nov 1, 2023, at 12:48 PM, Dan <dan27649@xxxxxxxxx> wrote:on
I’m reviewing an old RPGLE batch program that has logic to retry a CHAIN
an update file whenever the CHAIN fails because the record is locked byit
another job. It uses a loop to wait 20 seconds and retry the CHAIN, and
loops ten times. And I’m left wondering why one wouldn’t just overridethe
WAITRCD value for the file before opening it. We use the system default
WAITRCD(60), so the logic currently waits 80 seconds in total (60+20)
between each attempt, and gives up after 800 seconds. Is there a good
reason why overriding with WAITRCD(800) and doing away with the current
loop logic wouldn’t be a better option? I’m going to guess that the
original developer wasn’t aware of files’ WAITRCD attribute.
(And, yes, the logic does process the error after exiting the loop.)
- Dan
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.