edmiRemoteGetOpenModeBN
EdmiError edmiRemoteGetOpenModeBN(SdaiServerContext serverContextId, SdaiString repositoryName, SdaiString modelName, SdaiAccessMode *openMode, SdaiInvocationId *edmiInvocationId);
Returns the current open mode of a model or repository within a locally connected database. This feature has been implemented to provide all EDMInterface functionality through the remote EDMInterface calls. Only applicable for the LOCAL_CONTEXT communication type.
Arguments
Type | Name | Comment |
 SdaiServerContext | serverContextId | Context identification, from edmiDefineServerContext |
 SdaiString | repositoryName | If the argument <modelName> is NULL or an empty string, this is the name of the data repository for which to change its open mode. Otherwise, this is the name of the repository that contains the model for which to change its open mode. Repository names are case sensitive |
 SdaiString | modelName | The name of the model for which to change its open mode. Model names are case sensitive. If this argument is NULL or an empty string, this operation will change the open mode of the repository <repositoryName> |
 SdaiAccessMode | openMode | A variable that will receive the current access mode to the model or repository. Possible access modes are sdaiRO, sdaiRW and sdaiNOACCESS. |
 SdaiInvocationId | edmiInvocationId | Currently not used. |
Return Value
Â
Options
 Â
Â
Example
Â
 EdmiError rstat; SdaiServerContext myLocalContext; SdaiModel modId; SdaiInteger index, nHits; SdaiInstance johnnysId; /* Define Remote Server Context */ rstat = edmiDefineServerContext("MyLocalContext", NULL, NULL, NULL, "LOCAL_CONTEXT", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &myLocalContext); /* Get the modelId of MyModel */ rstat = edmiRemoteGetModelBN(myLocalContext, "DataRepository", "MyModel", &modId, NULL); /* Find Johnnys Id (Unique PID = 4572314) */ rstat = edmiRemoteFindInstancesBN(myLocalContext, modId, "Person", "PID = 4572314", sizeof(SdaiInstance), &index, &nHits, &johnnysId, NULL); /* If Johnny has a cellular phone, then confiscate it */ { SdaiString _attrName = "CELLULAR"; SdaiBoolean *_isSet; SdaiAccessMode _openMode; rstat = edmiRemoteTestAttrsBN(myLocalContext, johnnysId, 0, 1, &_attrName, &_isSet, NULL); if (*_isSet) { /* Get current open mode for MyMoodel */ rstat = edmiRemoteGetOpenModeBN(myLocalContext, "MyRepository", "MyModel", &_openMode, NULL); if (_openMode != sdaiRW) { /* Set write access to the model */ rstat = edmiRemoteChangeOpenMode(myLocalContext, modId, sdaiRW, NULL); } /* Confiscate the cellular */ rstat = edmiStartModelWriteTransaction(modId); rstat = edmiRemoteUnsetAttrsBN(myLocalContext, johnnysId, 1, &_attrName, NULL); rstat = edmiCommitAllTransactions(); /* Reset the initial open mode on the model */ if (_openMode != sdaiRW) { rstat = edmiRemoteChangeOpenModeBN(myLocalContext, "MyRepository", "MyModel", _openMode, NULL); } } } . . .
Â
See also
Filter by label
There are no items with the selected labels at this time.
Â