SetInMem

Syntax

GetInMemResult SetInMem(SetInMemArg tArg)

Parameters

tArg. Operation execution parameters.

Description

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

Comments

The operation enables or disables the use of In-Memory cache in repository cube or dictionary. To execute the operation, in the tArg.cache.object field specify repository object, and in the tArg.cache.action field specify the operation executed with cache. When cube caching is enabled, cache is created based on cube full selection. If the tArg.metaGet field is defined, the operation results in the updated information about In-Memory cache for object.

To update cube cache based on partial selection, use the UpdCubeCache operation.

NOTE. To provide correct work of the operation, cache files should be used only by the current server.

Example

Below is the example of preparing In-Memory cache of repository cube. The request contains cube moniker and operation executed with cache. The operation will be executed synchronously, and after cube caching is complete, 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