SetInMem

Syntax

GetInMemResult SetInMem(SetInMemArg tArg)

Parameters

tArg. Operation execution parameters.

Description

The SetInMem operation changes In-Memory cache of repository object.

Comments

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.

Example

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.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SetInMem xmlns="http://www.fsight.ru/PP.SOM.Som">
<tArg xmlns="">
<cache>
<object>
<id>
  <id>S1!M!5857</id>
  </id>
  </object>
  <action>Prepare</action>
  <async>false</async>
  </cache>
<metaGet>
<cache>
<object>
<id>
  <id>S1!M!5857</id>
  </id>
  </object>
  </cache>
  </metaGet>
  </tArg>
  </SetInMem>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SetInMemResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<meta xmlns="">
<cache>
  <isOK>1</isOK>
<object>
<id>
  <id>S1!M!5857</id>
  </id>
  </object>
  <objectStatus>Exists</objectStatus>
  </cache>
  </meta>
  </SetInMemResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"SetInMem" :
{
"tArg" :
{
"cache" :
{
"object" :
{
"id" :
{
"id" : "S1!M!5857"
}
},
"action" : "Prepare",
"async" : "false"
},
"metaGet" :
{
"cache" :
{
"object" :
{
"id" :
{
"id" : "S1!M!5857"
}
}
}
}
}
}
}

JSON response:

{
"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:

Working with In-Memory Cache | UpdCubeCache: Operation