edmiRemoteOpenModel
EdmiError edmiRemoteOpenModel(SdaiServerContext serverContextId, SdaiString remoteRepositoryName, SdaiString remoteModelName, SdaiAccessMode openMode, SdaiString superUserPassword, SdaiClientId clientId, SdaiOptions options, SdaiModel *modelId, SdaiInvocationId *edmiInvocationId);
This function has two areas of application;
- Opens a model within a locally connected database. This feature has implemented to provide all EDMInterface functionality through the remote EDMInterface calls. Only applicable for the LOCAL_CONTEXT communication type.
- Opens a model within one or optionally all the EDMapplicationServer processes used by the EDMserver. This is a password protected feature meant for system administrators only.
The application server processes of an EDMserver needs to load and maintain local copies of the database files that belongs to its open models. If these models are big, the handling of their files may be time consuming. Therefore, the superuser may use this function to open models from one or more application server processes, thereby reducing the delay for the first user that need to access the model. An EDMapplicationServer is a process that implements the remote EDMInterface operations invoked by the EDMclients. An EDMserver may have from one to any number of EDMapplicationServer processes. In most cases the EDMdatabaseServer and the EDMapplicationServers constitute the EDMserver. This is denoted an EDMserverRoom. Except for the communication type LOCAL_CONTEXT, all remote EDMInterface operations are stateless. However, this particular operation will not implicitely open the models parent repository. The repository must be opened by a separate call to edmiRemoteOpenRepository. Note that dictionary models and STEP Identifier models will only be opened for read access by this operation.
Arguments
Type | Name | Comment |
SdaiServerContext | serverContextId | Context identification, from edmiDefineServerContext |
SdaiString | remoteRepositoryName | The name of the repository in the remote EDMdatabase that contains the model to open. Repository names are case sensitive. |
SdaiString | remoteModelName | The name of the model to open. Model names are case sensitive. |
SdaiAccessMode | openMode | Legal access modes are sdaiRO and sdaiRW. |
SdaiString | superUserPassword | The password for the superuser within the remote database. This argument is not required when the server context specifies communication type LOCAL_CONTEXT. |
SdaiClientId | clientId | The client Id of the Main Client connection of the EDMapplicationServer for which the model shall be opened. See the example. |
SdaiOptions | options | See description of available options below. |
SdaiModel | modelId | A variable that will receive the modelID that uniquely identifies the opened model. |
SdaiInvocationId | edmiInvocationId | Currently not used. |
Return Value
Â
Options
 Â
Option | Comment |
ALL_SERVERS | Open the model from all the EDMapplicationServer processes in the EDMserverRoom. |
Â
Example
Â
/* Open selected repositories and models to initialize a remote database */ int i; EdmiError rstat; SdaiServerContext suContext; SdaiRepository repositoryId; SdaiModel modelId; SdaiQueryResult qexRes; SdaiInteger nRepository, nModel; SdaiInteger index; /* Define Remote Server Context for the superuser */ rstat = edmiDefineServerContext("SuperUserContext", "superuser", NULL, "xfx56kl9", "TCP", "9090", "MyServerHost", NULL, NULL, NULL, NULL, NULL, &suContext); /* Find and open all repositories in the database that is not the 'SystemRepository', 'DictionaryRepository' or 'EDMvisualExpress' repository */ index = 0; rstat = edmiRemoteSelectInstances(suContext, "SystemRepository", "ExpressDataManager", "EDM_REPOSITORY", "(NAME <> 'SystemRepository') AND \ (NAME <> 'DictionaryRepository') AND \ (NAME <> 'EDMvisualExpress')", 0, "NAME", NULL, NULL, &index, &nRepository, &qexRes, NULL, NULL, NULL, NULL); for (i=0;i<nRepository;i++) { rstat = edmiRemoteOpenRepository(suContext, ((SdaiString *) qexRes->columnDescr[0]->pvalue)[i], sdaiRW, "xfx56kl9", 0, ALL_SERVERS, &repositoryId, NULL); } edmiFreeQueryResult(qexRes); /* Find and open all models in the database that is not in the 'SystemRepository', 'DictionaryRepository' or 'EDMvisualExpress' repository */ index = 0; rstat = edmiRemoteSelectInstances(suContext, "SystemRepository", "ExpressDataManager", "EDM_MODEL", "(REPOSITORY.NAME <> 'SystemRepository') AND \ (REPOSITORY.NAME <> 'DictionaryRepository') AND \ (REPOSITORY.NAME <> 'EDMvisualExpress')", 0, "REPOSITORY.NAME NAME", NULL, NULL, &index, &nModel, &qexRes, NULL, NULL, NULL, NULL); for (i=0;i<nModel;i++) { rstat = edmiRemoteOpenModel(suContext, ((SdaiString *) qexRes->columnDescr[0]->pvalue)[i], ((SdaiString *) qexRes->columnDescr[1]->pvalue)[i], sdaiRW, "xfx56kl9", 0, 0, &modelId, NULL); } edmiFreeQueryResult(qexRes); . . .
Â
See also
Filter by label
There are no items with the selected labels at this time.
Â