Code-table caching¶
Loads and caches PPD and reserve-services reference code tables in module-level Static variables, avoiding repeated database round-trips within a process.
| Field | Value |
|---|---|
| Operation ID | code-table-caching |
| Trigger | First call to an mdlPPD or mdlReserveServices accessor function, or an explicit Refresh argument |
| Inputs | Optional Refresh boolean |
| Outputs | Cached code-table collections |
| Primary components | mdlPPD, mdlReserveServices |
| Entry point | SAIF.Business.Claim/mdlPPD.vb |
Steps¶
- Caller invokes an accessor function on
mdlPPD(e.g., for PPD body parts) ormdlReserveServices. - If the module-level
Staticcache variable is empty, orRefresh = Trueis supplied, load the code table: - PPD body parts (SQL-026, CL_PPD_BODY_PART_CODE).
- Vocational service types (SQL-035, CL_RESERVE_VOC_SERV_TYPE_CODE).
- Otherwise, return the previously cached collection without querying the database.
- The cache persists for the lifetime of the hosting process; there is no expiry and no synchronization.*
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Accessor function called]) --> Cached{Static cache populated<br>and Refresh = False?}
Cached -->|Yes| Return([Return cached collection])
Cached -->|No| Load["Query code table from<br>database"]
Load --> Store["Store into Static cache<br>variable"]
Store --> Return
Failure and edge-case behavior¶
- The cache has no expiry and no synchronization, making it process-lifetime and not thread-safe; concurrent ASP.NET requests share the same cached state.*
Related documentation¶
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with**could not be confirmed; treat as unknown until verified.
Sources¶
- SAIF.Business.Claim/mdlPPD.vb
- SAIF.Business.Claim/mdlReserveServices.vb