|
Mohammad:
* (pr**ivate reply)*
Read very carefully the description of READE vs. READ in the RPG manual ...
Chances are very good that READE does *not* do what you *bel**ieve* it
does. READE does a READ and *then* compares the key for "equal" and if
not equal, it does another READ ... *(lather**, r**inse**, repeat...)* So,
these implicit READs can and will read the same records that are already
locked by other jobs and will "hang" waiting on the lock. =-O
Rather than SETLL / READE try using CHAIN instead ...
Hope that helps ...
Mark S Waterbury
On 10/26/2018 9:21 AM, Mohammad Tanveer wrote:
I have 4 async jobs running, reading data from a data que and calling same
program A with order number.
JOB1 --> Read Data Que --> Call Program A to read File X and update for the
order#
JOB2 --> Read Data Que --> Call Program A to read File X and update for the
order#
JOB3 --> Read Data Que --> Call Program A to read File X and update for the
order#
JOB4 --> Read Data Que --> Call Program A to read File X and update for the
order#
Order File X:
RRN ( X ) Primary Key Order number
3,561,503 55,008,465 19,083,706
3,561,505 55,008,467 19,083,707
3,561,507 55,008,469 19,083,708
3,561,509 55,008,471 19,083,709
Program A --> Does SETLL and READE on a conditional logical file using
order# as the key field.
- JOB1 processed order# 19,083,706 and giving MSGW record in use for
RRN(X) 3561509
- JOB2 processed order# 19,083,709 and kept the lock on RRN(X) 3561509
for over 60 seconds
- JOB3 processed order# 19,083,707 and giving MSGW record in use for
RRN(X) 3561509
- JOB4 processed order# 19,083,708 and giving MSGW record in use
for RRN(X) 3561509
Is there a bug in READE that for some reason its trying to read/lock a
record for a different key or I say next record? logic is simple order#
setll , order# reade.. When we get MSGW we just do a RETRY and all works
fine.
I noticed that someone had a similar issue but there is no clear answer of
this behaviour of READE.
article >>>>>>>>
https://itknowledgeexchange.techtarget.com/itanswers/rpgle-setll-reade-for-update-getting-record-lock-on-different-keying/
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.