GetInMemResult SetInMem(SetInMemArg tArg)
tArg. Operation execution parameters.
The SetInMem operation changes In-Memory cache of repository object.
The operation enables or disables the use of In-Memory cache in a cube or a repository dictionary. To execute the operation, in the tArg.cache.object field specify repository object, and in the tArg.cache.action field specify the action executed with cache. When cube caching is enabled, cache is created by the full cube selection. If the tArg.metaGet field is defined, the operation results in the updated information about object's In-Memory cache.
To update cube cache by partial selection, use the UpdCubeCache operation.
NOTE. To provide correct operation work, cache files should be used only by the current BI server.
Below is the example of preparing In-Memory cache for repository cube. The request contains cube moniker and the action executed with the cube is specified. The operation is executed synchronously, and after the cube caching is complete, the updated information about cache status is returned.
The example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier example.
{
"SetInMem" :
{
"tArg" :
{
"cache" :
{
"object" :
{
"id" :
{
"id" : "S1!M!5857"
}
},
"action" : "Prepare",
"async" : "false"
},
"metaGet" :
{
"cache" :
{
"object" :
{
"id" :
{
"id" : "S1!M!5857"
}
}
}
}
}
}
}
{
"SetInMemResult" :
{
"meta" :
{
"cache" :
{
"isOK" : "1",
"object" :
{
"id" :
{
"id" : "S1!M!5857"
}
},
"objectStatus" : "Exists"
}
}
}
}
public static GetInMemResult SetInMemParams(MbId mb, string objectId)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
var objKey = FindObjectById(mb, objectId).k;
//Operation execution parameters
var tSet = new SetInMem()
{
tArg = new SetInMemArg()
{
cache = new SetInMemCacheArg()
{
action = InMemCacheAction.Prepare,
async = false,
@object = new InMemCacheObject()
{
id = new OdId() { id = mb.id + "!" + objKey }
}
},
metaGet = new GetInMemArg()
{
cache = new GetInMemCacheArg()
{
@object = new InMemCacheObject()
{
id = new OdId() { id = mb.id + "!" + objKey }
}
}
}
}
};
//Change object caching parameters
var result = somClient.SetInMem(tSet);
return result;
}
See also: