Initializing a Node
The jomInitialize call, shown in the following example, must be the first call made to the JADE Object Manager module.
int jomInitialize(DskHandle *pNodeHandle, DskParam *pDirectory, DskParam *pServerType, DskParam *pIniFile)
This call opens the database and initializes the buffers for a new node. The Windows process can call this API once only, unless a call to the jomFinalize API call is issued before the subsequent call.
The code in the following example uses the C++ API to sign on to the JADE Object Manager. (If you use the code in this example, make sure that you change variable values so that they are appropriate for connecting to your system.)
DskParam directoryParam; paramSetCString(directoryParam, "<dbPath>"); DskParam serverTypeParam; paramSetCString(serverTypeParam, JOM_MULTIUSER_TAG); ShortDskParam iniParam; paramSetCString(iniParam, "<iniFile>"); // open the jom database - once per node DskHandle nodeHandle; int result = ::jomInitialize(&nodeHandle, &directoryParam, &serverTypeParam, &iniParam); CHECK_RESULT;
The parameters for the jomInitialize call are described in the following subsections.