Directory Services

The ADSI Property Cache

The ADSI object model provides a client-side property cache for each ADSI object. The property cache can be thought of as a table in memory that contains the names and values of all of an object's properties. ADSI uses property caching to enhance the performance of property manipulation and add transactioning capability for property read and write operations. This capability is critical for clients written in languages that have no native batching mechanism for setting properties, such as Microsoft® Visual Basic. Without the ADSI property cache, such clients would have to access the server every time a property is read or written.

When an object is created or first bound to, the property cache for the object is empty. When the IADs::GetInfo method is called, ADSI loads the properties for the object from the underlying directory service into the local cache. When a specific property value is read and the cache is empty, ADSI makes an implicit call to the IADs::GetInfo method. When the cache is filled, all property read operations work on the contents of the cache only.

When a property value is written, the new value is only stored in the local cache until the IADs::SetInfo method is called. When the IADs::SetInfo method is called, the properties in the cache are committed to the underlying directory service. After the IADs::SetInfo method is called, the values remain in the cache until explicitly refreshed with another call to the IADs::GetInfo method.

Important  The IADs::GetInfo method must be used carefully because this method updates all of the property values in the cache from the underlying directory service. That is, it will overwrite property values that have been changed in the cache, but not committed to the underlying directory service with a call to the IADs::SetInfo method.

The following figure shows the different methods used to operate on the cache.

ADSI property cache