IMetabaseCache.FlushInstance

Syntax

FlushInstance(Key: Integer; Values: IMetabaseObjectParamValues): Boolean;

Parameters

Key. Repository object key.

Values. Values of object parameters.

Description

The FlushInstance method flushes repository object cache by its key and specified parameters values.

Comments

The method returns True if cache is flushed successfully.

This method use increases productivity while working with objects that have parameters, for example, a cube that controls parameters of its dimensions. If the FlushInstance method is used, cache flushing is possible by the selected dimension and not by all while opening the cube.

Example

Executing the example requires that the repository contains a parametric table dictionary with the OBJ_TBL_DICT identifier. The first parameter of this dictionary must have real type. Add a link to the Metabase system assembly.

    Sub UserSub;
    Var
        Mb: IMetabase;
        Cache: IMetabaseCache;
        Obj: IMetabaseObject;
        ParamVals: IMetabaseObjectParamValues;
    Begin
        Mb := MetabaseClass.Active;
        Cache := Mb.Cache;
        Obj := Mb.ItemById("OBJ_TBL_DICT").Bind;
        ParamVals := Obj.Params.CreateEmptyValues;
        ParamVals.Item(0).Value := 66;
        Cache.FlushInstance(Obj.Key, ParamVals);
    End Sub UserSub;

After executing the example cache of a table dictionary is flushed only by its first parameter in repository cache.

See also:

IMetabaseCache