-p on LOOKUPs - further clarification?
Mike Schwartz
mschw at athenet.net
Fri Jun 15 14:02:13 PDT 2007
>release the lock. Also, I believe it will release if
>you execute another lookup with the same alias.
I'm pretty sure this is correct. This is why you can't loop through a
detail file and fill an array on an order screen, then update the array and
then write the whole array back to the detail file. After you fill your
array and "display" the detail screen, you have to re-open the one record
the user is actually updating in "protected" mode, using another lookup that
has a "-P" (protect).
For example:
lookup arry1 = OrdDetail (not protected)
lookup crsr = OrdDetail (protected)
Do a "getnext" to loop through the "arry1" lookup 16 times until your
screen is filled. Then, as the user moves the cursor up and down through
the screen, execute the "crsr" lookup on each line to protect that one
record until the user finishes updating it. As the user finishes updating
the info on that line and moves the cursor down, so that the next "crsr"
lookup is performed, the record that the user just left will be
"automagically" unlocked.
I suppose if you wanted to lock all 16 detail lines at a time, you could
do so by creating 16 lookups; Arry1, Arry2...Arry16. However, this should
be quite unnecessary because there usually isn't any reason to lock a detail
record, except for the one record that the user is modifying.
>Strictly speaking, I don't think that filepro does
>cache any writes - I would presume that this would be
>handled by the OS if appropriate and should work
>transparently.
>Jeff Harrison
Unfortunately, it IS usually the operating system that is not writing
the records to disk promptly. The 'filePro PFSYNC command has fixed a lot
of these kinds or errors for me. I've had some (mostly older) caching SCSI
cards where I've even had to resort to PFSYNC=ALL. This isn't limited to
Unix, though. There was a particular era of bad E-IDE caching controllers,
in combination with Windows M.E. (Ugh!) that gave me a lot of cache flushing
grief until I turned on PFSYNC. (The same computers after upgrading to
Windows 2000 seemed to work OK without the PFSYNC.)
Mike Schwartz
More information about the Filepro-list
mailing list