skip to main content
Corticon Server: Data Integration Guide : Advanced EDC Topics : Using caches in EDC for entities and queries : Specifying caching on Vocabularies and Rulesheets
 

Try Corticon Now
Specifying caching on Vocabularies and Rulesheets

Setting caching on datastore persistent Entities in the Vocabulary

Database caching is a feature of an EDC Datasource connection, enabling both Entity caching and Query caching.
To set Entity caching in a Vocabulary:
1. Identify the Vocabulary entities that you want cached.
2. Edit the Vocabulary.
3. Confirm (or set) each entity's Datastore Persistent property to Yes
4. Choose the preferred Datastore Caching value:
*No Cache or blank (default) - Disable caching.
*Read Only - Caches data that is never updated. This strategy works well for unchanging reference data that might need to occasionally be flushed and repopulated. For example, countries of the world.
*Read/Write - Caches data that is sometimes updated while maintaining the semantics of "read committed" isolation level. If the database is set to "repeatable read," this concurrency strategy almost maintains the semantics. Repeatable read isolation is compromised in the case of concurrent writes. See https://sqlperformance.com/2014/04/t-sql-queries/the-repeatable-read-isolation-level for a discussion of this functionality.
*Nonstrict Read/Write - Caches data that is sometimes updated without ever locking the cache. If concurrent access to an item is possible, this concurrency strategy makes no guarantee that the item returned from the cache is the latest version available in the database. This works well for data that changes and must be committed, but it does not guarantee exclusivity or consistency (and so avoids the associated performance costs). This strategy allows more than one transaction to simultaneously write to the same entity, and is intended for applications able to tolerate caches that may at times be out of sync with the database.

Set query caching on Entities in a Rulesheet

In a Rulesheet, caching can be set on an Entity and on a database filter. You can use either or both.
Note: Query caching is independent of entity caching's Datastore Caching setting.
To use query caching on an entity in a Rulesheet:
1. In a Rulesheet, choose Advanced view to show the Scope tab. Datastore-persistent entities have a database decoration.
2. Right-click on a datastore-persistent entity, and then choose Extend to Database.
3. Right-click again on the same datastore-persistent entity, and then choose Cache Query, as shown:

Set query caching on database filters in a Rulesheet

To use query caching on a database filter in a Rulesheet:
1. In a Rulesheet, choose Advanced view to show the Scope tab. Datastore-persistent entities have a database decoration.
2. On the Filters tab, right-click on a filter that references an entity extended to database, and then choose Database Filter. The filter is decorated with a database symbol.
3. Right-click on that filter again, and then choose to Cache Query, as shown: