Commerce Server objects that support transactions implement the IConfigurationCache interface. By implementing this interface, transacted objects are able to govern the way in which they cache their own configuration information.
When a transacted pipeline initializes a transacted object, it can query for an interface pointer on the object's IConfigurationCache implementation. Through this pointer, the pipeline can call the component's SaveToCache method. This method is implemented by the component to generate a key that uniquely identifies the component's configuration information.
You can think of this key just as you would think of the primary key to a database table; the primary key is a unique handle to a row of information. In the case of IConfigurationCache, the row is the information that the component stores in a persistent medium and uses to configure itself. Generally, this key is simply the class identifier of the transacted component. However, a component's configuration key can be any item of information that enables the component to load its configuration information from storage.
The IConfigurationCache interface defines the following methods.
Method | Purpose |
---|---|
FreeCache | Deletes the specified configuration key. |
LoadFromCache | Loads an object's configuration information based upon the specified key. |
SaveToCache | Returns an out-value BSTR to the pipeline. This BSTR variable is a unique key that indicates the configuration to load. |