...
Code Block | ||||
---|---|---|---|---|
| ||||
EdmiError edmiRemoteOpenDatabase (SdaiServerContext serverContextId,
SdaiString location,
SdaiString databaseName,
SdaiString password);
|
Opens a remote EDMdatabase
...
from a thin EDMclient. The EDMdatabase
...
will be attached to the EDMserver
...
specified in the given server context. An EDMdatabase
...
may not be accessed until it is opened by a call to this function.
...
In a single-user system the EDMserver
...
is embedded in the EDMinterface
...
. In a multi-user system the EDMserver
...
and the EDMclients will be running as separate processes, possibly on different systems.
...
The EDMserver
...
may not handle more than one EDMdatabase
...
at the time. Any open EDMdatabase
...
must therefore be closed before opening another.
...
This operation is protected with the EDMdatabase
...
password. This password is defined when the EDMdatabase
...
is created.
...
Arguments
...
Type | Name | Comment |
SdaiServerContext | serverContextId | Context identification, from edmiDefineServerContext |
SdaiString | location | The full path to the directory on the remote file system where the EDMdatabase is located. The directory delimiter is '/' on UNIX platforms and '\' on Windows platforms. |
SdaiString | databaseName | The name of the _the EDMdatabase _ to open. _ EDMdatabase _ names are case sensitive on UNIX platforms and case insensitive on Windows platforms. |
SdaiString | password | The password for the EDMdatabase. The password is defined by the edmiCreateDatabase function. |
...
Return Value
...
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
Options
...
Example
...
Code Block | ||
---|---|---|
| ||
int i; EdmiError rstat; SdaiServerContext suContext; tEdmiWhoIsOnServer *pWhoIsOn; tEdmiConnection *pConnect; SdaiInteger nConnect; /* Define Remote Server Context for the superuser */ rstat = edmiDefineServerContext("SuperUserContext", |
...
"superuser", NULL, "xfx56kl9", |
...
"TCP", "9090", "MyServerHost", |
...
NULL, NULL, NULL, NULL, NULL, &suContext); |
...
/* Set the system unavailable */ |
...
rstat = edmiRemoteSetUnavailable(suContext, |
...
"System unavailable due to maintenance", |
...
NULL, NULL); |
...
rstat = edmiRemoteWhoIsOn(suContext, &nConnect, &pWhoIsOn, NULL); |
...
pConnect = pWhoIsOn->connections; |
...
/* Kill all connections except the |
...
EDMapplicationServer processes */ |
...
for (i=0;i<nConnect;i++) { |
...
SdaiString _hostName, _clientName; |
...
rstat = edmiRemoteGetClientNames(suContext, |
...
pConnect->clientId, &_hostName, |
...
&_clientName, NULL); |
...
if (!strstr(_clientName, "EDMapplicationServer-")) { |
...
rstat = edmiRemoteTerminateClient(suContext, NULL, |
...
pConnect->clientId, FORCE_TO_TERMINATE, NULL); |
...
} ++pConnect; |
...
} /* Close the database */ |
...
rstat = edmiRemoteCloseDatabase(suContext, "db546tyz", NULL); |
...
/* Perform system maintenance here */ |
...
/* Reopen the database */ |
...
rstat = edmiRemoteOpenDatabase(suContext, "x:/mypro/db", |
...
"mydb", "db546tyz"); |
...
/* Set the system available for |
...
connections from EDMclients */ |
...
rstat = edmiRemoteSetAvailable(suContext, NULL, NULL); |
...
. . . |
See also
Filter by label (Content by label) | ||||||
---|---|---|---|---|---|---|
|