ICubeInstanceDestination.FlushCache

Fore Syntax

FlushCache;

Fore.NET Syntax

FlushCache();

Description

The FlushCache method clears cache of the opened cube instance.

Comments

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.

Fore Example

A cube with the CUBE_WDI identifier is supposed to be in the repository.

To execute the example, add links to the Metabase and Cubes system assemblies.

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.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

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(NullAs ICubeInstance;
    CubeInstDest := CubeInst.Destinations.DefaultDestination;
    CubeInstDest.UpdateCache();
    System.Diagnostics.Debug.WriteLine(CubeInstDest.Cached);
    CubeInstDest.FlushCache();
    System.Diagnostics.Debug.WriteLine(CubeInstDest.Cached);
End Sub;

See also:

ICubeInstanceDestination