When reading cases from a
data source, CSPro optimizes the reading of
items so that only items used in the application are read. This results in the faster execution of applications, particularly batch applications and
tools, which may use only a few of the dictionary's items.
When compiling an application, CSPro keeps track of items that are referenced in logic. These are the items that are read when reading a case (either as part of the application or via a function call such as
loadcase). In addition to the items referenced in logic, all items are read in the following scenarios:
- Data entry applications: All items for the main dictionary are read.
- Batch applications: All items for the main dictionary are read when outputting data (as specified in the PFF or using setoutput).
- External dictionaries: All items are read if they may be written (e.g., using writecase).
- Other logic functions: All items are read when logic functions are used that depend on having all items (e.g., Case.view).
The default behavior is suitable for most applications, but sometimes you may want to turn off case read optimization. For example, if using an action such as
Data.getCase, the CSPro compiler does not know which dictionary will be bound to that action at runtime, so the optimization may lead to items not being read that you will eventually want at runtime.
There are two ways to override this behavior, which is set on a per-
dictionary basis. You can use the
dictionary property panel to disable
Read Optimization. This setting is applicable for every application that uses the dictionary. Alternatively, to control this on a per-application basis, you can use the
preprocessor to disable the setting: