|
Instead of a data area that is accessed by multiple programs have you
thought about communicating via a data queue, or a message queue, to a
central job that maintains the data area?
Or if you don't like that approach, then check for %error when doing the
IN operation. If there is an error then does positions 40-46 of the
program status data structure (PSDS) display the right error id and
positions 91-170 of the PSDS display enough message data to determine who
has it locked? And, again, if there is an error then will a sleep() work?
Keep in mind that if you IN with a lock, then you should OUT or unlock
asap.
Or even better yet, if this is V5R2 and this data area is a number that is
incremented to get a number, like order#, etc., then redefine the field in
your file to be a ROWID and let the system automatically increment it.
Rob Berendt
--
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
Benjamin Franklin
"Lim Hock-Chai" <Lim.Hock-Chai@xxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
05/27/2003 01:21 PM
Please respond to RPG programming on the AS400 / iSeries
To: "RPG programming on the AS400 / iSeries"
<rpg400-l@xxxxxxxxxxxx>
cc:
Fax to:
Subject: RE: Dataarea lock problem
This only happen about 2 to 3 times for the past two years. I'was not
able to recall what the share status were.
All I can recall is when this happen, all the jobs (a lot of them) that
try to call the RPG program to access the dataarea were all getting the
time-out cpf error. Because a lot of jobs were failing, I got no choice
but ended those jobs that were in HELD status. Everything start to
working again after I ended those (HELD) jobs.
-----Original Message-----
From: Fisher, Don [mailto:Dfisher@xxxxxxxxxxxxxxxxx]
Sent: Tuesday, May 27, 2003 12:02 PM
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: Dataarea lock problem
You're looking at the wrong column. The column with "HELD" merely informs
you the object has been acquired by the process for whatever purpose
needed.
Next to the column with the "HELD" value should be a column with such
statuses as "SHRRD", "SHRUP", etc. This column tells you how the process
is
using the object. Any process using *LOCK to acquire the data area should
have "SHRUP" in this column, if I remember correctly.
Check out the CL programming manual under object locking or WRKOBJLCK for
more information on what these values mean.
Hope that helps.
Donald R. Fisher, III
Project Manager
Roomstore Furniture Company
(804) 784-7600 extension 2124
DFisher@xxxxxxxxxxxxxxxxx
<clip>
1) When do WRKOBJLCK on the dataarea, sometimes I'll see three or four
programs in HELD status and the other in wait status. The question is how
can multiple jobs lock a dataarea.
<clip>
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.