FlushCache;
FlushCache();
The FlushCache method clears cache of the opened cube instance.
Caching provides a possibility to reduce loading time and provides quicker access to some data. If source data does not correspond to cached data, the cache clearing is required.
To execute the example, add links to the Metabase and Cubes system assemblies. A cube with the CUBE_WDI identifier is supposed to be in the repository.
Sub UserProc;
Var
MB: IMetabase;
CubeInst: ICubeInstance;
CubeInstDest: ICubeInstanceDestination;
Begin
MB := MetabaseClass.Active;
CubeInst := MB.ItemById("CUBE_WDI").Open(Null) As ICubeInstance;
CubeInstDest := CubeInst.Destinations.DefaultDestination;
CubeInstDest.UpdateCache;
Debug.WriteLine(CubeInstDest.Cached);
CubeInstDest.FlushCache;
Debug.WriteLine(CubeInstDest.Cached);
End Sub UserProc;
After executing the example the cache of the cube with the CUBE_WDI identifier will be cleared.
Imports System;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Cubes;
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
CubeInst: ICubeInstance;
CubeInstDest: ICubeInstanceDestination;
Begin
MB := Params.Metabase;
CubeInst := MB.ItemById["CUBE_WDI"].Open(Null) As ICubeInstance;
CubeInstDest := CubeInst.Destinations.DefaultDestination;
CubeInstDest.UpdateCache();
System.Diagnostics.Debug.WriteLine(CubeInstDest.Cached);
CubeInstDest.FlushCache();
System.Diagnostics.Debug.WriteLine(CubeInstDest.Cached);
End Sub;
The result of executing the example matches with that of the Fore example.
See also: