|
Thanks Darryl,
I can see how the trailer record could help in that case,
but, thankfully, I've not yet had that problem.
I'm trying to sync separate programs in separate jobs
so file members made by job 1 can be transferred to
job 2 without corrupted data or dead-locks.
Each job has its 'own file' where members are stored
until they can be processed, but at some point file 1
members must get copied to file 2 and that is the
point where I want to avoid contention/corruption.
My first try will be to use a data area each program
reads/writes so each program 'sees' when the
other needs exclusive use of the WAIT_Q file.
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of
Darryl Freinkel
Sent: Tuesday, October 21, 2014 2:41 PM
To: Midrange Systems Technical Discussion
Subject: Re: How to avoid file corruption transferring members from one
file to another
I don't remember how I did this at other sites, but you could write a
trailer file to the target system folder when you have completed sending
the file. The target system could monitor for the file and then start
processing the file when its done.
Sometimes the target system is too quick for the sending system to
complete it processing and the file may not be done by the time the target
reads it and as a result misses a bunch of records.
On Tue, Oct 21, 2014 at 2:40 PM, Gary Thompson <gthompson@xxxxxxxxxxx>
wrote:
I have program FTP_ASN_1 sending EDI 856 ASN documents to a remoteserver.
If an FTP connection can't be made to the remote, the ASN document issent
copied to a member file WAIT_Q, and the ASN program continues with the
next ASN as our warehouse completes the next shipment.
We may not be able to connect to the remote FTP server for a few
minutes or some hours, possibly a day.
I have program FTP_ASN_2 pulling ASN documents that have not yet been
from members in a file I call SEND_Q. A separate file is used to avoid
contention
with FTP_ASN_1.
When FTP_ASN_2 finds no member in SEND_Q, it stops its FTP process and
looks to copy any members from WAIT_Q to SEND_Q and then remove all
_copied_ members from SEND_Q.
My question is how to avoid 'collisions' between FTP_ASN_1 and
FTP_ASN_2 during the time members are being 'moved' from WAIT_Q to
SEND_Q ?
My ideas have so far included:
Use a single data area and require both FTP_ASN_1 and FTP_ASN_2 to
lock the data area before adding new or copying/deleting WAIT_Q
members.
Have both FTP_ASN_1 and FTP_ASN_2 get exclusive control of WAIT_Q
with ALCOBJ.
Looking for any advice or comments about design pitfalls . . .
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/midrange-l.
--
Darryl Freinkel
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
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.