× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 09/26/2018 04:52:24
PM:
----- Message from "T. Adair" <tadair@xxxxxxxxxxxxxxxx> on Wed, 26
Sep 2018 15:52:04 -0500 -----

To:

rpg400-l@xxxxxxxxxxxx

Subject:

Re: High level record lock

I realize that. I should have said "virtually simultaneously". Within
a honkosecond of each other.

And this is exactly why a high-level-record lock would be great. No
matter how small the time difference, the first pgm to read the record
needs to lock the entire universe out of it until it releases it. Then,

and only then, can someone else grab it.

Thanks.

~TA~



On 9/26/2018 3:26 PM, Charles Wilt wrote:
PGM A (batch) PGM B (interactive)
------------- -------------------
Reads record - (simultaneously) - Reads same record

Not possible with RPG RLA.... unless you are doing a READ(N) and not
locking the record...

Charles


Charles is correct. It doesn't matter how quickly the other program tries
to read the record. If you are using a standard read (for update) in RPG
(or any other language for that matter), the record is locked exclusively
to that program within that job. You have to do something (i.e., update
the record or read another one) to release that exclusive lock. Any other
jobs/routines trying to access the record will go into a *LCKW status.
When PGM A does the UPDATE on the record (with the new value) then the
lock is released and the first job to have entered a *LCKW status will be
able to read the record. If multiple processes are waiting, they will all
wait in turn until they come to the top of the stack as the record is
released.

If you're not seeing this, then the second program has to be executing a
READ(N) or CHAIN(N). If the second job has done an override on the default
wait time or the default has been changed, the process may continue, but
signals an error--i.e., the read does not complete successfully.

The operating system has implemented the high-level record lock you are
requesting since the early days of the System/38.

Michael Quigley
Computer Services
The Way International

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

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.