FlushInstance(Key: Integer; Values: IMetabaseObjectParamValues): Boolean;
Key. Repository object key.
Values. Values of parameters of an object.
The FlushInstance method flushes cache of repository object by its key and specified parameters values.
FlushInstance returns True if cache is successfully flushed.
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.
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.FlushInstance(Obj.Key, ParamVals);
End Sub UserSub;
After executing this example cache of a table dictionary is flushed only by its first parameter in repository cache.
See also: