...
Code Block | ||||
---|---|---|---|---|
| ||||
EdmiError edmiRemoteOpenRepository(SdaiServerContext serverContextId,
SdaiString remoteRepositoryName,
SdaiAccessMode openMode,
SdaiString superUserPassword,
SdaiClientId clientId,
SdaiOptions options,
SdaiRepository *repositoryId,
SdaiInvocationId *edmiInvocationId);
|
This function has two areas of application;
- Opens a repository within a locally connected database. This feature has implemented to provide all EDMInterface functionality through the remote EDMInterface calls. Only applicaple applicable for the LOCAL_CONTEXT communication type. See example 1.
- Opens a repository within one or optionally all the EDMapplicationServer processes used by the EDMserver. This is a password protected feature ment meant for system administrators only. See example 2.
The application server processes of an EDMserver needs to load and maintain local copies of some of the database files. If these files are big, the handling of them may be time consuming. Therefore, the superuser may use this function to open repositories from one or more application server processes, thereby reducing the delay for the first user that requires access.
...
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.
...
Arguments
...
Type | Name | Comment |
SdaiServerContext | serverContextId | Context identification, from edmiDefineServerContext |
SdaiString | remoteRepositoryName | The name of the repository to be opened in the remote _EDMdatabase{_}remote EDMdatabase . Repository 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 repository shall be opened. See the example. |
SdaiOptions | options | See description of available options below. |
SdaiRepository | repositoryId | A variable that will receive the repositoryID that uniquely identifies the opened repository in the remote EDMdatabase. |
SdaiInvocationId | edmiInvocationId | Currently not used. |
...
Return Value
...
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
Options
...
Option | Comment |
ALL_SERVERS | Open the repository from all the EDMapplicationServer processes in the EDMserverRoom. |
...
Example
...
Code Block |
---|
...
| ||
/* 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 (Content by label) | ||||||
---|---|---|---|---|---|---|
|