Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

Data Compatibility

Data and index files created by the FairCom Server or any traditional FairCom DB application are interchangeable. By interchangeable we mean:

  • FairCom Server files can be accessed by traditional FairCom DB applications. The only exception is a file with transaction processing support enabled by specifying a ctTRNLOG or ctPREIMG file mode. The transaction processing file modes are set at file creation time. Once a file supports transaction processing, all record updates to this file, for example AddRecord(), ReWriteRecord(), etc., must be encompassed by Begin() and Commit() calls. This also means that only single user and client applications can update these files since only these modes offer transaction processing. However, files supporting transaction processing can be opened in a ctREADFIL mode and read by any application, whether it includes the transaction processing logic or not, since ctREADFIL mode will not allow file updates.
  • Files created with traditional FairCom DB applications can be copied to the FairCom Server directory and used by the FairCom Server.

In both cases above is the application index node size of the source application must be the same as or less than the index node size used by destination application. FairCom DB applications set parameters for buffers, files and sect with InitCTree(), InitISAM(), or the initialization record of the ISAM parameter file. The sector parameter determines the node size for an index, sect * 128, when it is created. Once an index file is created with a certain node size, all applications accessing this index must use the same node size, or a larger one. The FairCom Server can be viewed as an application accessing the index. To interchange data and index files between traditional FairCom DB applications and the FairCom Server the index node size must be the same. Superfiles can ONLY be accessed with the exact index node size used to create them.

There are two methods for setting the index node size the same between application index files and the FairCom Server:

  1. Change the sect value within the application to be compatible with the FairCom Server. Divide the FairCom Server PAGE_SIZE by 128 to give the value for sect. After changing the sect setting in the application, rebuild the data file to recreate the index file(s) to the new node size.

    Note: It is not possible to rebuild a superfile with a new node size. If this is required, write a conversion program or use the method below to solve this compatibility problem.

  2. The FairCom Server sets its node size based on the PAGE_SIZE found in ctsrvr.cfg, defaulting to 8192. The second method is to set PAGE_SIZE in the Server configuration file, ctsrvr.cfg, to be compatible with the sector size of the existing index files, where sect * 128 <= PAGE_SIZE. If the PAGE_SIZE is altered, the index files will be compatible without a rebuild. The PAGE_SIZE is a crucial option affecting FairCom Server performance. Change the PAGE_SIZE only when it is not practical to rebuild the index files.
  • When client applications will be on mixed platforms, i.e., Unix and Windows, ensure a DODA is included in the data files. This will ensure numeric key values are handled consistently. Otherwise, High-Low/Low-High translation will result in inconsistent key values.
  • Whether or not you are migrating to the FairCom Server, see Migrating Your Application Between Operational Models for information critical to the different operational models, including the client/Server model.