The Function of Protect Spec and Protect Records
Published By | Date | Version | Knowledge Level | Keywords |
---|---|---|---|---|
Revelation Technologies | 24 JAN 1990 | 2.X | INTERMEDIATE | CONTROL, CONVERSION, VALIDATION, DICT.MFS, PROTECT.MFS, PROTECT.SPEC, SECURITY, TRANSACTION, CONTROL |
With Advanced Revelation 2.0, you now have the option of adding control features on a per-file basis. These control features were required for a clean implementation of native SQL, but are a generally useful addition to the environment. You can activate control features by adding PROTECT.MFS to the file.
The addition of PROTECT.MFS to a file provides:
- Optional or enforced data validation
- Automatic data conversion input and output
- Transaction control
- Security (not yet implemented)
The specification of these features, at the most fundamental level (regardless of the tool used), is the data dictionary.
%PROTECT.SPEC%
DICT.MFS detects significant changes to the dictionary record at write time and maintains a specification record that details which fields need checking and what checks are to be performed. The specification record is stored in the dictionary and is named %PROTECT.SPEC%.
Like %FIELDS%, the %PROTECT.SPEC% specification record is not a conventional dictionary record. It contains one entry for each field for which some validation or conversion is required (in other words, for which there is an input or output conversion). If there is not conversion for the field, there is no entry in %PROTECT.SPEC%. If the specification record is missing, it will be rebuilt from the dictionary at the next low-level open. If the specification record is deleted from the dictionary, the file must be re-attached and re-opened for the specification record to be rebuilt.
%PROTECT%
When control features are active, data funnelled through cursors (all SQL statements use cursors) is subject to automatic validation and conversion. In order to optimize this process, a pre-compiled module is added to the dictionary, rather than having the I/O modules rely on an interpretive process. This pre-compiled module is called %PROTECT%.
The %PROTECT% module is a symbolic field in which field 8 is replaced by the EXE version number under which it was compiled. The system checks %PROTECT% each time there is a low-level open. This check verifies that the pre-compiled module is in place and that its version number matches that of the current EXE. The module is compiled or recompiled as necessary.