sdaiOpenSession


Opens an _EDMserver_ session for subsequent access. No access to data in an _EDMdatabase_ is permitted before an _EDMserver_ session is opened by this operation.
If the caller is not already connected to an EDMserver, this operation will connect the caller to the actual EDMserver with the EDMuser account sdai-user and the EDMgroup account sdai-group. This automatic connection in the sdaiOpenSession function enables standard SDAI applications to use the EXPRESS Data Manager system without any modifications.
A numeric sessionID that uniquely identifies the instance of type sdai_session that defines the open _EDMserver_ session is returned by this operation.
Related function: sdaiCloseSession
Header:
#include "sdai.h"
Prototype:
SdaiSession sdaiOpenSession(void);
Arguments:
None.
Returns:
A numeric sessionID that uniquely identifies the instance of type sdai_session that defines the open _EDMserver_ session.
sessionID != 0 : operation successfully performed.
sessionID = 0 : operation failed, use sdaiErrorQuery function to get error reason.
Example:
SdaiSession sessionId;
EdmiError rstat;
...
rstat = edmiOpenDatabase("/usr/hkd/databases/", "merci", "x12xhkd");
if (rstat) {
/* Error in operation */ 
printf("\nError: %s in edmiOpenDatabase \n", 
edmiGetErrorText(rstat)); 
goto error; 
}
sessionId = sdaiOpenSession();
if (! sessionId) {
/* Error in operation */ 
printf("\nError: %s in sdaiOpenSession \n", 
edmiGetErrorText(sdaiErrorQuery())); 
goto error; 
}
. . .