Release 10.1A: OpenEdge Development:
Progress Dynamics Advanced Development

> ## Cache versus a shared cache

> There are two important notions of how the cache should operate when confronted with multiple instances of one SDO. The first notion is simple caching. Here, the first instance of an SDO creates a record in the cache, and that record will remain in the cache for the entire session or, optionally, for a specified period of time. Each subsequent instance of the SDO ignores existing cache records and creates its own cache record. This essentially means that each new instance of the SDO will hit the AppServer for its own result set and store it in the cache. This is not a common use case.

> Simple caching is enabled and configured with the `CacheDuration` property of the SDO. This property accepts the following values:

> - If it has a value of zero, then simple caching is disabled (the default).

> - If it has an integer value greater than zero, then the SDO’s cache becomes a timed cache with a duration equal to the number of seconds specified by the integer. The cache records will be destroyed when two things happen: the last instance using the cache record is destroyed and the amount of time specified expires.

> Note: If two instances specify different values for a timed cache, the shortest duration specified is the duration the CacheManager will use.

> - If it is set to the Progress Unknown value (?), then the data in the SDO is cached for the life of the session.

> The second notion is called sharing. If a cache is shared, then the first instance of the SDO will create the cache record, and each subsequent instance will use the data in that cache record. When all instances of the SDO are closed, the cache record is also destroyed. The first new instance of the SDO will create a new cache record.

> Shared caching is enabled with the logical `Shared` property of the SDO:

> - If this property is true, then the SDO’s cache is a shared cache.

> - If this property is false, then the SDO’s cache is not a shared cache.

> Note: When both types of caching are enabled, the caching occurs at the SDO level and the data is shared among all instances. This cache will be valid for the session.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095