The OpenEdge database stores a number of CRC values in metaschema tables. These are used to ensure that the precompiled ABL code is compatible with the current database Schema.
The three kinds of CRC stored in the metaschema tables are:
1. Trigger CRCStored in: _File-Trig._Trig-Crc and
_Field-Trig._trig-CrcPurpose: To prevent the code for defined schema triggers from being substituted by another trigger that does something different.Value: The CRC value for the compiled trigger procedure specified for a given Database trigger.
Relation to ABL code: When the .p for the schema trigger is (pre-)compiled, a CRC value for the code is generated. When a schema trigger gets executed, this CRC value from the compiled code is compared to the one strored in the metaschema to ensure the code matches what the database expects.
2. Table CRCStored in: _File._CRCPurpose: Provide a value for a table definition which is unique based on the
attributes of a table which affect how the data is stored. The AVM relies on this record layout structure when running code that works on the table.
Value: The value is calculated when the schema definitions are loaded or updated. The metaschema fields involved in the update are documented in Article:
Relation to ABL code: When ABL code is compiled to R-code, the CRC values of referenced tables is included in the .r file.
- When running a pre-compiled program from r-code, the AVM checks if the CRC listed in the r-code matches the value stored in the metaschema.
- When running against the same database instance, this will identify if there were changes to the table schema that would require the code to be recompiled.
- When running against different instances of the same database, this will identify if the schema for those different instances is in sync so the code can run as expected.
3. Index CRCStored in: _Index._Idx-CRCPurpose: Provide a value that's unique for the functional aspects of an index (name, included fields, sort order). The AVM relies on this to track which index should be used for statically defined data access logic.
Value: The value is calculated when the index schema definitions are loaded or updated. The metaschema fields involved in the update are documented in Article:
Relation to ABL code: When ABL code is compiled to R-code, the CRC values of referenced tables is included in the .r file.
- When running a pre-compiled program from r-code, the AVM checks if the CRC listed in the r-code matches the value stored in the metaschema.
- When running against the same database instance, this will identify if there were changes to the index that would require the code to be recompiled.
- When running against different instances of the same database, this will identify if the schema for those different instances is in sync so the code can run as expected.
The Index CRC did not exist in Progress 8.x. In that release series, index definitions are included in the Table CRC. It was split off starting with Progress 9 to make the relationship between AVM and database less restrictive. Specifically this makes it possible to add new indexes and drop unused indexes without having to recompile application programs. However, if the application code is not re-compiled a new index will not be used.