During FCFL.NET initialization, frequently used and seldom updated data is pulled into memory as cache objects. The cached data is exposed as read only strongly typed objects.
fcSDK-based applications utilize cached objects to avoid extra round trips to the database which results in a dramatic application performance boost. They also make it easier to write fcSDK-based applications as commonly used data is readily available through strongly typed objects.
The cached objects are loaded during ClarifyApplication initialization. If enabled, cache objects will be persisted to the file system (cache files) as it is much faster to load the cache objects directly from the file system rather than the database.
During initialization:Creation of cache files can be disabled using a configuration setting. The location of the cache files is also configurable.
Cache information can get out of date. Currently the only built-in cache object that will automatically detect if it is out-of-date is the Schema Cache. If you update non-schema data that you know to be cached you have two options.
[C#]
//update the Schema Cache |
[Visual Basic]
'updates the Schema Cache |
The fcSDK comes with four built-in caches available through properties on ClarifyApplication. Each cache has some common characteristics:
The SchemaCache allows you to programmatically browse the Clarify Schema at runtime. You can find out what Fields are in a View or what Relationships are present for a Table.
Schema Cache Usage Example[C#]
//get a reference to the case table |
[Visual Basic]
'get a reference to the case table |
The ListCache provides access to user defined (HierarchicalStrings) and global (GlobalStrings) lists.
The LocaleCache provides access to Country, State and TimeZone information.
For more information on how TimeZones are used in fcSDK see also Time Zone Handling.
The StringCache allows access to all the localizable application strings present in the string_db or fc_string tables.
This cache is slightly different in that it does not expose a collection and its accessor methods start with “Find”.
Data that is often accessed and seldom updated can benefit from caching. fcSDK's built-in caches attempt to cover basic Clarify and First Choice database objects that meet this criteria. However, custom Clarify implementations may data that could also benefit from caching. By editing the application configuration file one or more Custom Cache Providers can be added and automatically put into memory during initialization.
While caching of often used, read-only data can greatly boost application performance please be aware that there are downsides to caching:
Basic Configuration | Time Zone Handling | Configuring Custom Data Providers