IMetabaseCache.FlushInstanceById

Syntax

FlushInstanceById(Id: String; Values: IMetabaseObjectParamValues): Boolean;

Parameters

Id. Identifier of repository object.

Values. Values of parameters of an object.

Description

The FlushInstanceById method flushes cache of repository object by its identifier 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: cube that controls parameters of its dimensions. If the FlushInstance method is used while opening the cube cache flushing is possible by chosen dimension, not by all.

Example

Executing the example requires that the repository contains a parameterized table dictionary with the OBJ_TBL_DICT identifier. The first parameter of this dictionary must be of real type. It is also necessary to 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.FlushInstanceById("OBJ_TBL_DICT", 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