FATS - Fast Access Tree System
Table of Contents
List of Commands
"Y" Auto Refresh

"Y" Auto Refresh


Command string:

CMND$ = "Y\{RefreshMode}"

RefreshModeNetwork parameters

Purpose:

Specifies file locking and cache modes in single- and multi-user environments.

Description:

With this command you determine the behavior of FATS accessing all index files.
Normally it is sufficient to apply this instruction one time at the program start whereby the specified access mode will apply to all coming opened files, i.e. they are accessed either with network or single workstation access.

The adjustments can also be changed at runtime, but then they will affect all opened index files.
For example you can switch between single- and multiuser operation at runtime or on and off the cache.

If you want to open files with the attribute "read-only" or with exclusive rights of access, then this adjustment has to be made before the actual open command is executed. You have to switch back to the normal access mode to insure that the coming opening commands are not affected by this adjustment.

If you want to reorganize a index file for example, you can activate the cache algorithm with "Y\5" or "Y\106", then build the entire file and finally restore the original status (e.g. "Y\0", "Y\2"). The operation can be speed up for 30 times.

On the next pages a compilation of the adjustments follows:

Y\0Single workstation, OS-Flush (standard adjustment)

After each command that makes changes to the index file all data is immediately written to disk. In addition, FATS does perform the reset disk operations that cause the operation system to flush its cache buffers to the disk and actualizes the directory structure.
Thus it is guaranteed that after the call of FATS all changed data were written on the disk.

Note that the OS flush activated with this adjustment usually takes 3/4 up of the operating time. As alternative to this adjustment "Y\4" can be selected to accelerate all data manipulating commands on a single workstation enormously.
 

Y\1Single workstation, OS-Flush, Refresh

This adjustment is identical to "Y\0" except that before each FATS command the head data of the index file are read in again and all accompanying cache buffers are marked as obsolete. You may use this in network systems that are not supported by FATS directly.
 

Y\2Network environment, wait for lock, OS-Flush, Refresh

When your application executes a search command the index file is read-locked. This prevents other stations from writing to that index file, but they are still allowed read access to it. When your application executes a command that makes changes to the index file, the file is write-locked for the duration of the command. The file is unlocked before returning back to the calling application. At no time the index file will be locked outside of FATS.
FATS performs locking automatically and transparently to the user. It will wait for a index file to become available when another station holds the lock for that file.

In order to ensure a network reliable operation, all stations that access the same index file have to use the same adjustment.
 

Y\3Network environment, no wait for lock, OS-Flush, Refresh

Like "Y\2" except that FATS will return immediately to the application with an errorcode of 144 when another station holds the lock for a key file. The application must contain logic either to wait and retry the operation or to report the error to the user when the lock is busy.
 

Y\4Single workstation, no flush, no refresh

This adjustment is identical to the adjustment "Y\0" except that FATS does not perform the reset disk operations that cause the operation system to flush its cache buffers to the disk.
This will provide significant time savings when building index files for large data files but you cannot assume that any of your updates have been written to the disk until you perform a close operation.
 

Y\5Single workstation, no Flush, no refresh, use cache

- - - - very fast - - - -

FATS does not perform writes to the operation system until its cache is full and the least-recently-used algorithm controlling the I/O buffer cache selects a buffer for reuse. FATS never writes to the index file unless the cache buffers are entirely filled during a single command. In addition, FATS does not perform the reset disk operations that cause the operation system to flush its cache buffers to the disk. It does not close and reopen the file each time it physically expands in order to flush the directory structure.
When using this adjustment, you cannot assume that any of your updates have been written to the disk until you either perform a close operation or execute the command  Write Page Map (W).

Use "Y\106" instead of "Y\5" in an network environment.
 

Y\106Network environment, exclusive open mode, no flush, no refresh

- - - - very fast - - - -

Like "Y\5", except that the file must reside on a shared device:

With this adjustment you can specify that FATS opens a index file in exclusive open mode. When a station opens a file in exclusive mode, no other station can open the file until the station that opened the file in exclusive mode closes it.
 

Y\107Network environment, all stations read-only

If you open a index file in the read-only mode, your application can only read the file, it cannot perform updates. Any attempt to execute a command that makes changes to the index file will result in an errorcode 25 (write error).

Once a station successfully opens a index file in the read-only mode, others will be able to open the file only if they also use read-only mode.
 

Y\108Network environment, exclusive open mode, OS-Flush, Refresh

Like "Y\106", except that after each command that makes changes to the index file all data is immediately written to disk (see also "Y\0").
 

Y\109Network environment, wait for lock, forced server flush

Some network servers hold data to be written to a file in internal buffers to increase performance for small writes. With this adjustment you can specify that FATS forces these buffers to be written to the server immediately after each command that makes changes to the index file.
Thus it is guaranteed that after the call of FATS all changed data are written on the server disk.
This bypasses the cache algorithms provided by the server os and therefore generally requires processing time overhead to operate.
 

Y\110 Network environment, no wait for lock, forced server flush

Like "Y\109" except that FATS will return immediately to the application with an errorcode of 144 when another station holds the lock for a index file. The application must contain logic either to wait and retry the operation or to report the error to the user when the lock is busy.
 

Y\111 Network environment, exclusive open mode, forced server flush

Like "Y\108", with guaranteed server-flush (see "Y\109")

(The command extension Y\x\xx of Fabs Plus 4.3 is not supported by FATS.)

Parameters returned:

ERRORCODE:Errorcode or 0 (no error)
RECNO:Undefined
FATSKEY:Undefined

See also:

 "W" Write Page Map; page 4-77
 "Z" Reload File Buffers; page 4-77


 

© 2008  GCS Software, Udo Gertz