PreviousNext

Placing Entries in the Local DUA Cache

A special object OM class, DSX_C_GDS_CONTEXT, is provided in the GDS package to allow an application program to manage the placement of entries in the local DUA cache as a result of a directory request.

DSX_C_GDS_CONTEXT inherits the OM attributes of its superclasses OM_C_OBJECT and DS_C_CONTEXT. To enable caching entries, the DS_DONT_USE_COPY OM attribute of DS_C_CONTEXT must be set to a value of OM_FALSE, indicating that a directory request can access copies of directory entries maintained in other DSAs or copies cached locally.

DSX_C_GDS_CONTEXT has the following private extension OM attributes in addition to the OM attributes inherited from DS_C_CONTEXT:

· DSX_DUAFIRST

· DSX_DONT_STORE

· DSX_NORMAL_CLASS

· DSX_PRIV_CLASS

· DSX_RESIDENT_CLASS

· DSX_USEDSA

· DSX_DUA_CACHE

DSX_DUAFIRST determines where a query operation, such as a search or list, looks first for an entry. The default value is OM_FALSE, indicating that the DSA is searched first. If the entry is not found, then the DUA cache is searched.

DSX_DONT_STORE determines if information read from the DSAs by a query function also needs to be stored in the DUA cache. If this OM attribute is set to OM_TRUE, nothing is stored in the cache. If this OM attribute is set to OM_FALSE, the information read is stored in the DUA cache. The objects returned by ds_list( ) and ds_compare( ) are stored in the cache without their associated attribute information. The objects returned by ds_read( ) and ds_search( ) are stored in the cache with all their cachable attributes; these are all public attributes that do not exceed 4Kbytes in length.

The three different memory classes that the user can specify for a cached entry are DSX_NORMAL_CLASS, DSX_PRIV_CLASS, and DSX_RESIDENT_CLASS.

DSX_NORMAL_CLASS assigns the entry to the class of normal objects. If the number of entries in this class exceeds a maximum value, the entry that is not accessed for the longest period of time is removed from the DUA cache.

DSX_PRIV_CLASS assigns the entry to the class of privileged objects. Entries can be removed from the class in the same way as normal objects. However, by setting this area of memory aside to be used sparingly, the user can protect entries from deletion.

DSX_RESIDENT_CLASS assigns the entry to the class of resident objects. An entry in this class is never removed automatically. It must be explicitly removed by using an XDS ds_remove_entry( ) function applied directly to the cache; that is, DSX_DUA_CACHE and DSX_USEDSA are set to OM_TRUE and OM_FALSE, respectively.

The tables below show the possible conditions that result when DSX_DUA_CACHE and DSX_USEDSA are set to OM_TRUE.


Cache Attributes: Read Cache First

OM Attribute Type OM_TRUE OM_FALSE
DSX_DUA_CACHE X
DSX_USEDSA X
DS_DONT_USE_COPY X
DSX_DUAFIRST X
In the situation presented in the preceding table, the cache is read first, then the other DSAs. The requested operation is permitted to use copies of entries.


Cache Attributes: Read DSA First

OM Attribute Type OM_TRUE OM_FALSE
DSX_DUA_CACHE X
DSX_USEDSA X
DS_DONT_USE_COPY X
DSX_DUAFIRST X
In the situation presented in the preceding table, the DSA is read first, then the cache. The requested operation is permitted to use copies of entries.


Cache Attributes: Read DSA Only

OM Attribute Type OM_TRUE OM_FALSE
DSX_DUA_CACHE X
DSX_USEDSA X
DS_DONT_USE_COPY X
DSX_DUAFIRST N/A N/A
In the situation presented in the table above, only the DSA is read. The requested operation is not permitted to use copies of entries.

The following tables show the possible situations when DSX_DUA_CACHE and DSX_USEDSA are not both set to OM_TRUE.


Cache Attributes: DSX_USEDSA is OM_FALSE

OM Attribute Type OM_TRUE OM_FALSE
DSX_DUA_CACHE X
DSX_USEDSA X
DS_DONT_USE_COPY X
In the situation presented in the preceding table, the DUA Cache is used exclusively.


Cache Attributes: DSX_DUA_CACHE is OM_FALSE

OM Attribute Type OM_TRUE OM_FALSE
DSX_DUA_CACHE X
DSX_USEDSA X
In the situation presented in the preceding table, the DSA is used exclusively.


Cache Attributes: Error

OM Attribute Type OM_TRUE OM_FALSE
DSX_DUA_CACHE X
DSX_USEDSA X
In the situation presented in the preceding table, neither the DSA nor the DUA cache is used, and an error is returned.