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



Doug wrote:
I have two files SourcePF is my physical file and SourceLF is a logical
built over that PF. Both are included in the program as update files with
add.

In a subroutine the program sets a HIVAL on the logical and then does a
readp in order to get the highest shipping number. At this point I
believe this field is locked and no other process can access read that
record.


The SourcePF/SourceLF /record/ is locked, not the field, and no other
program that has either file defined as Update can access /this/ record, but
programs that have it defined as Input can...


it then increrments the count and writes it to a variable. The
other variables are setup and then the program finally writes a new record
to the Physical file, which at that point the lock is released correct?


NO, the logical file record is locked until you do:
1) A dummy except to release it
2) Any file operation that will read another record or reposition the file
pointer, such as a SETLL, Read, Readp, or Chain


I am just checking every possible place for this thing to create duplicate
records (I did not write the code, just plugging the hole).....and making
sure that neither program can dup up the same number.


I would suggest that you instead have a 'next number' file to assign these
key numbers rather than using the current technique. Your program would
call a program/procedure that retrieves the 'next number' record, adds 1 to
it, check to see if that key exists in the SourceLF (just to double-check in
the case that the 'next number' isn't out of synch with the file), looping
until the key is NOT found in SourcePF, then write a record to either
SourcePF or SourceLF.

- sjl



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.