Salesforce

What are the different types of CRC stored in the database's metaschema ?

« Go Back

Information

 
TitleWhat are the different types of CRC stored in the database's metaschema ?
URL NameP122121
Article Number000131206
EnvironmentProduct: Progress
Version: 8.x, 9.x
Product: OpenEdge
Version: All supported versions
OS: All supported platforms
Question/Problem Description
Why are there different types of CRC stored in the database's metaschema 
Where is the "Check CRC" flag stored 
What are CRC values used for 
What are the CRC values stored in  _file-trig._trig-crc  _field-trig._trig-crc   _file._crc  _Index._idx-crc
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution
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 CRC

Stored in: _File-Trig._Trig-Crc and _Field-Trig._trig-Crc

Purpose: 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 CRC

Stored in: _File._CRC

Purpose: 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 upd
ate 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 CRC

Stored in: _Index._Idx-CRC

Purpose: 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.
Workaround
Notes
Keyword Phrase
Last Modified Date11/20/2020 7:29 AM

Powered by