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



1. When capturing the time for storing in the client file, use this same time in the archive file, with the seconds.
2. Flag each archive number as soon it is used. This update must occur immediately after the read.
3. Use a time-out trap. If the write to the archive file is, say, more than 1 minute after the write to the client file, do not continue and issue a message to the user, to an adminstrator and to the helpdesk.

This may suffice. If the number of transactions is large, you may need something more sophisticated.

Regards,
John McKay
www.mnckaysoftware.ie
www.rpglanguage.com


----- Original Message ----- From: "Takken, Cor" <cor.takken@xxxxxxxxxx>
To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
Sent: Wednesday, November 19, 2008 9:39 AM
Subject: RE: problem with duplicate records


What is done here is relying on chance to generate a correct reference
number. Time as a reference to an event, however precise you define it
to be, will always allow for situations where two events to happen at
the same time. It would have been much safer to use an unique
(sequential?) number to use as a key as you can ensure that there is
only one instance handing out the numbers, be it the system or a user
defined program or another method. You can still use time as a log-entry
mechanism, and in this case it would have logged the fact that two
archive entries have been made at the same time. Allowing a time as a
reference number is brittle architecture which has now proven this
point.

My two euro-cents,

Cor

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-
bounces@xxxxxxxxxxxx] On Behalf Of David FOXWELL
Sent: woensdag 19 november 2008 9:33
To: RPG programming on the AS400 / iSeries
Subject: problem with duplicate records

Hi,

Two users have managed to create the same archive reference number
while creating two different clients.

Like this :

ArchiveFile
Product1 Client1 RefNo1 10:41:57(time)
Product2 Client2 RefNo1 10:41:57

The program would crash if the problem occurred with the same product.
As it is 2 users in different services created the records at the same
time.

The user enters the client details and hits the enter key.
The program writes the client to the client file then calls an
external
procedure to find an unused archive number then write this number to
the archive file.

The client files look like this
Product1_clients
Client1 created at 10:41:53

Product2_clients
Client2 created at 10:41:56

I'm assuming that the creation of client1 took so long that the
creation of client2 caught up. The same time in the ArchiveFile is
just
a hazard.

I can think of ways to fix it, but I'd rather ask what are we doing
wrong?

Thanks.
--
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 e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.


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