Logging Out

After the user completes one or more database operations and finishes with Essbase, your program should log out from the server. Logging out can be done either as a result of an explicit user request or automatically (for example, after a specific sequence of actions is complete). All active connections should also be logged out before the program terminates and exits.

It is not always necessary for the program to log out after each data access operation. Whether to log out (and so release Essbase Server ports) or remain logged in (giving faster response to successive user requests) is a design judgment call.

/* C Example of logging a user out */
ESS_STS_T       sts;
ESS_HCTX_T      hCtx;
sts = EssLogout (hCtx);
hCtx = ESS_INVALID_HCTX;

' VB Example of logging a user out
Dim     sts as ESB_STS_T
Dim     hCtx as ESB_HCTX_T
sts = EsbLogout (hCtx)
hCtx = ESB_INVALID_HCTX

After logging out, do not use that same context handle. That will probably crash your program.

If you want to dispose of a local context handle, use EsxDeleteLocalContext():

/* C Example of deleting a local context handle */
ESS_STS_T       sts;
ESS_HCTX_T      hLocalCtx;
sts = EssDeleteLocalContext (&hLocalCtx);

' VB Example of deleting a local context handle
Dim     sts as ESB_STS_T
Dim     hLocalCtx as ESB_HCTX_T
sts = EsbDeleteLocalContext (hLocalCtx)