|
message: 3
date: Tue, 15 May 2018 08:05:43 -0500
from: Joe Pluta <joepluta@xxxxxxxxxxxxxxxxx>
subject: Re: One Write, two records....
Hi Costa!? Welcome to the world of intermittent errors.? :)
On these, the first thing to do is to identify the possible causes and
eliminate some of them.
In my mind, here are the possibilities:
1. Program A is getting called twice for the same order
2. Program A is calling program B twice for the same line
3. Program B is being called once but executing WRITE twice
4. Program B is executing WRITE once but the IBM i database is writing
two records
5. Some unknown program C is doing the same WRITE as program B
Someone might come up with more, but those are my choices.? Option 4 is
awfully far-fetched, but I include it for completeness.? Use a journal
if you suspect option 5; it will tell you if some other program or job
is writing to the same file.
Other than that, then, you have options 1, 2 and 3.? Option 1 seems
unlikely since the duplicate is for only certain lines.? So let's check
2 and 3.? The brute force method is pretty simple. Create a file with
program name, order and line number.? Every time program A calls program
B, it writes a record to that file. Every time program B writes a record
to the order file it also writes a record to the work file.
The next time the duplicate occurs, interrogate the file.? Either you'll
see program A calling program B twice with the same order and line, or
you'll see program A calling program B once and program B writing the
record twice.? That will identify which part of the business logic needs
to be debugged more thoroughly.
I know it's pretty basic stuff, but that's what I do.? A lot.? So I've
gotten pretty good at it.? :)
Hello,
The whole team I work with is facing a weird issue.
Program A loops per order and calls program B, program B is doing just a
write to a file (order lines) using the input parms from A.
Occasionally though, program B is writing 2 lines (duplicate) for some of
the order lines, not all. By deleting the records and rerunning the
process, no duplicates are written.... So we can not reproduce the fault.
I added a FEOD in pgm B, but we still get the duplicates once in a while.
The release is V7R1M0.
Both programs are RPGLE, in DFTACTGRP.
Any hints?
Thank you in advance,
Costa
This mailing list archive is Copyright 1997-2026 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.