FATS - Fast Access Tree System
Table of Contents
 Network Operation

Network Operation


 Network Ability
 Improvements
 Safety Operation
 Activation of Network Operation
 Exclusive Open Mode
 Read-Only File Access
 Critical Commands
 Increasing File Handles


 
 
Network Ability

FATS is standardly equiped for the network environment. Nearly all commands can be executed both in single workstation and network environment.

The network systems Novell, Windows for Workgroups, Bayon Vines, NetBios and all MS-Net compatible networks are supported by FATS. When executing FATS with MS-Windows 3.x or in peer-to-peer networks the MS-DOS program SHARE.EXE has to be loaded. Other networks require own drivers (NETX, ODI).


 
 
Improvements

FATS was optimized for the network operation. Different mechanisms guarantee just as safe as fast processing in the network.
Therefore it is not necessary for the application programmer to develop own network functions for the work with the FATS files


 
 
Safety Operation

In the network- and single workstation environment FATS offers a very high measure of safety for your data.
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.


 
 
Activation of Network Operation

By default the network functionality is deactivated. It can be activated with the  Auto Refresh (Y) command (see page 4-77).

Following adjustments activate the network operation:

Y\2 Network environment, wait for lock
Y\3 Network environment, no wait for lock

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 ("Y\2") or return immediately to the application with an errorcode of 144 ("Y\3") 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\109  Network environment, wait for lock, forced server flush
Y\110  Network environment, no 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.


 
 
Exclusive Open Mode

The network adjustments presented so far deactivate the cache routines built into FATS in favor of safety operation. These adjustments are useful with files that are constantly accessed by many stations.
In certain situations, e.g. the reconstruction or the reorganization of files or the handling of temporary files, with which only one station has access to a certain file, the cache routines would be desirable.
For these cases adjustments were implemented in FATS, which give exclusive file access rights to a station. The exclusive rights are activated as follows:

1.) Set access mode Y\106, Y\108 or Y\111

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.
Note: The files opened with this adjustment keep exclusive rights till they are closed. Other adjustments made with the "Y"-command can be changed at runtime.

The "Y\108" adjustment is equivalent to the adjustment "Y\2" explained on the previous page. The exclusive rights of access make additional locking unnecessary. The "Y\111" adjustment activates the "Server-Flush".
Finally the "Y\106" adjustment delays writing to the file.

A detailed description can be found at page  4-77.

2.) Open or create one or several index files

If you receive an errorcode during opening of a file possibly another station has already opened the file with exclusive rights of access.

3.) Switch back to the normal access mode (e.g. "Y\2", "Y\3")

After opening the file you have to switch back to the normal access mode to insure that the coming opening commands are not affected by the adjustment made in step one.


 
 
Read-Only File Access

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.

The read-only mode is activated as follows:

1.) Set read-only file access with Y\107
2.) Open or create one or several index files
3.) Switch back to the normal access mode
(e.g. "Y\2", "Y\3")


 
 
Critical Commands

Each modification of the index file by inserting or deletion of keys makes an internal pointer invalid that is necessary for the commands  Search Next (N) and  Search Previous (P). You better use the commands  Search Next After (A) and  Search Previous Before (E) because this can happen in the network environment from any station.

The following commands have to be replaced:

Search Next (N) >>  Search Next After (A)
Search Previous (P) >>  Search Previous Before (E)


 
 
Increasing File Handles

The base version of FATS for MS-DOS has been presented in two different versions:

FATS.OBJWorks with DOS file handles (DOS 2.x -)
(file path can be specified, compatible with FABS Plus 4.x)
FATS_.OBJWorks with File-Control-Blocks (CP/M mode)
(compatible with FABS 3.x)

For use in network the first version (FATS.OBJ) is recommended, however you have to pay attention that DOS normally allows only 15 file handles per process. Because your data files need handles to be accessed there are possibly no more handles available to FATS.
Starting with version 3.3 of MS-DOS there is a undocumented command that allows the extension of the handle table. To use this command your compiler may not reserve all available memory, i.e. memory has to be returned to DOS by reduction of the applicationīs heap memory. Please consider your compilerīs documentation for a corresponding command.
Also the FILES= entry in Config.sys has to be assimilated to the increased number of files.

If you want to access more the 15 file in your program you have to effect the following changes in your program:

- Change the FILES= entry in Config.sys(e.g. FILES=40 for 40 simultaneous opened files)

- If you use SHARE.EXE you have to increase the memory available for file locks with the instruction SHARE /F:nnnnn.
Please consider your MS-DOS manual.

The Novell Netware client for MS-DOS standardly permits 40 opened files.
This also can be changed if necessary.

- Reduce the size of the heap memory available to your application.With BASIC you can reach this by calling the SETMEM function.

- Call the interrupt function 67h of MS-DOS as described in the following example.

Example: (Visual Basic for DOS)

X = SETMEM(-16384) ' Return memory to DOS

InRegs.AX = &H6700 ' Number of SetFileHandles function
InRegs.BX = 41 ' New number of files (must be odd if it is to work
' with DOS 3.3)
CALL INTERRUPT(&H21, InRegs, OutRegs)


 

© 2008  GCS Software, Udo Gertz