records not locking?

Mike Schwartz mschw at athenet.net
Tue Jun 3 09:45:35 PDT 2014


> On Tue, Jun 03, 2014 at 09:10:24AM -0400, Boaz Bezborodko thus spoke:
> >
> >> When you have a simple command "WRITE" then Filepro writes all data
> >> to all open files and then UNLOCKS THEM.  They are no longer protected.
> >> If you want to selectively free up a record you're working on (say a
> >> main file for tracking the Invoice number and/or order number) then
> >> you should execute the command "WRITE <filename>".  This will write
> >> the data just for that file and then unlock it.
> 
> > I don't recall it being officially documented that write unlocks a
lookup.
> > I would consider that a big, glaring bug.  Close, yes...but write?
Nowhere
> near as much.  That's not even sensible.  That's like saying write(2)
should
> automagically negate fcntl() or flock() in C.  It's > insane.  The whole
purpose
> of locking is so that you have exclusive ability to write...and
write...and write
> some more, without interruption.
> 
> > mark->
> 
> My understanding is that a "write" unlocks the lookup.  I do a protected
> lookup if I'm writing to the file and then I do a "write" to save the data
and
> release the lock.
> 
> -- Chris

ALSO:

     If I recall correctly, a write of a file closes ALL the aliased lookups
to that file.  (I'm sure somebody will correct me if that's no longer
correct, but that's a rule I obey when I program...)  You never want to do
this:  Update a few fields, WRITE, reopen, update a few fields, write...
This will just kill your performance, if nothing else...

 ALSO check your PFSYNC setting:

PFSYNC=ON  tells filePro to update the directory entry for a file whenever
new records are added to its end.  This setting should ensure that any data
the user enters before a crash or unexpected power off are saved and the
file size is correct on rebooting. 
PFSYNC=ALL tells filePro to write (flush the memory buffers) on every update
to any file.  This is the safest setting (maybe even overkill) but much more
costly in terms of speed degradation.
PFSYNC can be set with the filepro configuration editor or in the normal
system environment.

ALSO here are some record writing rules: 

     A "lookup -p" time:
    The lookup is performed, and the record is located.
    The record is locked.
    The record is read.
    The record is used by processing. ...

When it's time to write/unlock the record[*]:
    The record is written.
    The record is unlocked.

[*]  Lookup records are written:
        At an explicit WRITE.
        At an explicit CLOSE.
        A GETNEXT/GETPREV is executed.
        The LOOKUP itself is re-executed.
        When processing ends.  Note that field-level events (such as
            @WLF/@WEF) ending do not constitute "processing ending".

     (This list is from [Ken Brody's] memory, so it may be incomplete.)

Mike Schwartz





More information about the Filepro-list mailing list