Record locking

John Esak john at valar.com
Wed Mar 31 09:42:03 PST 2004


> In an instance where things might stop, I never created the
> tracking number [similar to your order number] until the SAVE [eg
> EscEsc] was pressed.
>
> I trapped for that key, and the save routine then retreived the
> correct number.  I did this cleaning up a site that would have many
> numbers missing when the previous programmer retreived a number as
> one of the first things they did, and then when the order was
> never completed, there was no order and the control file had been
> perivously incremented so that it appeared to have holes in the
> order number list.
>
>
> --
> Bill Vermillion - bv @ wjv . com

Just as you do...

The only (or maybe the only) fix for this is to create a temporary "holding"
file for errant (unused) numbers. If the process gets stopped for whatever
reason, throw that number into this holding file. The main control number
file has already been incremented, and it may be getting hit from other
users already, so you can't do anything about setting it backwards or
whatever... so, instead, when a new unique number is desired... do a lookup
to this "holding" file first. If there is a number there, grab _it_ and
delete it from the holding file. Don't go near the main control_number file.
When there are _no_ numbers in the "holding" file... _then_ go get the next
number out of the main control_number file and incrment it as usual. This
will keep the list of used unique numbers straight without holes.  Some of
the numbers may not be used in date (or transational) order, but at least
all of the numbers will be used and there will be no holes.  Our bank
requires us to do this on our invoice numbers. What a pain... because for my
part, I could care less if there are holes in a unique number list.  Who
cares?  They were not used for whatever reason and that's that... but
accountants and such want it otherwise. They like to know check# such and
such was voided or torn up or fell in a puddle rather than its just not
being there in the nice sequential list they're looking at.  Again, for my
part, I could care less.

John



More information about the Filepro-list mailing list