× 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.



Hi,

It always depends on what I want to archieve.
For example in an interactive program I want to display the error, while in
a batch program I may want to retry reading the record until it will be
unlocked.

1. Catch the record lock and do what ever you want:
Monitor;
Read MyFileF;
On-Error 1218; //Record lock
//Do whatever you want on record lock
On-Error; //All other errors
//Do whatever you want
EndMon;

2. Retry to read the row until the record will be unlocked
DoU %Status <> 1218;
Read(E) MyFileF;
EndDo;
If %Error; //Handle all other errors
//Do whatever you want
EndIf;


Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"

-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im
Auftrag von Robert Rogerson
Gesendet: Friday, May 30, 2008 23:01
An: RPG programming on the AS400 / iSeries
Betreff: Retry for Record Lock in subprocedure...


We recently had a record lock in one of or new program (which uses
subprocedures and no exception error handling) and the program ended.
(Normally as I was to learn after reading related parts from the Redbooks
Who Knew You Could Do That with RPG IV and RPG Exception and Error Handling
as well as checking this list's archives.



From my understanding of what I have read once an exception is handled
there
is no way to retry the failing statement. In OPM programs, when a record
lock was encounter a retry option was available to the operator. Much of
what I read in the archives suggested fixing the program which was causing
the lock in the first place but I could not find any information on how
others were handling the record lock scenario in the program attempting the
lock.



If a batch job attempts to read a record for update and that record is
locked is there any way to retry the read so that the program doesn't
continue on with the next record.

I have seen examples of messages issued stating that the record is locked
and what job is locking the record. So the user who locked the record
completes his job releasing the lock. How or can the batch job now attempt
to reread the record? From what I have read I don't believe so but I would
like some confirmation or advise.



Thanks in advance,



Rob R




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.