Returns information about active sessions and requests. Similar to EssListRequests, but includes users hosted in a user directory.
Syntax
ESS_FUNC_M EssListRequestsEx (hCtx, UserId, bIsIdentity, AppName, DbName, RequestCount, pRequestInfo);
Parameter | Data Type | Description |
---|---|---|
hCtx | ESS_HCTX_T | API context handle (input). |
UserId | ESS_STR_T | User name or identity (input). If an identity, includes a unique identity string identifying the user in a user directory. |
bIsIdentity | ESS_BOOL_T | Indicates if a user identity or name is used (input). If TRUE, indicates that UserId is a unique identity attribute. If FALSE, UserId is a user name. |
AppName | ESS_STR_T | Application name (input). |
DbName | ESS_STR_T | Database name (input). |
RequestCount | ESS_PUSHORT_T | Number of requests (output). |
pRequestInfo | ESS_PREQUESTINFOEX_T | Request type (output). |
Notes
A session is the time in seconds between a user's login and logout.
A request is a query sent to Essbase by a user or by another process; for example, starting an application or restructuring a database outline. Each session can process only one request at a time; therefore, sessions and requests have a one-to-one relationship.
Some of the listed requests may have been recently terminated, but are still listed as active due to network delay.
This function returns information on requests/sessions initiated by the process specified by the UserID, AppName, and DbName. If these parameters are null or empty, then all the processes in the system are listed. This function returns the number of current requests and one ESS_REQUESTINFOEX_T structure for each request.
The returned ppRequestInfoStruct needs to be freed by calling EssFree.
Return Value
Returns zero if successful; error code if unsuccessful.
Access
This function requires the caller to have database designer privilege (ESS_PRIV_DBDESIGN) for the specified database.
Example
void ListRequestsEx () { ESS_STS_T sts = ESS_STS_NOERR; ESS_STR_T userId; ESS_BOOL_T bIsIdentity; ESS_USHORT_T numRequest; ESS_PREQUESTINFOEX_T requestInfo; ESS_USHORT_T index = 0; userId = "admin"; bIsIdentity = ESS_FALSE; sts = EssListRequestsEx(hCtx, userId, bIsIdentity, "Sample", "Sample1", &numRequest, &requestInfo); printf("\nEssListRequestsEx sts: %ld\n", sts); printf ( "Total requests on the server: %d\n", numRequest ); if ( !sts && requestInfo ) { while ( index < numRequest ) { printf ( "login ID = %ul\n", requestInfo[index].LoginId ); printf ( "user name = %s\n", requestInfo[index].UserName ); printf ( "login machine = %s\n", requestInfo[index].LoginSourceMachine ); printf ( "AppName = %s\n", requestInfo[index].AppName ); printf ( "DbName = %s\n", requestInfo[index].DbName ); printf ( "DbRequestCode = %u\n", requestInfo[index].DbRequestCode ); printf ( "RequestString = %s\n", requestInfo[index].RequestString ); printf ( "TimeStarted = %ul\n", requestInfo[index].TimeStarted ); printf ( "State = %d\n", requestInfo[index].State ); printf ( "\n\n--------------------------------------\n\n", requestInfo[index].State ); sts = EssKillRequestEx (hCtx, &requestInfo[index] ); index++; } EssFree ( hInst, requestInfo ); } userId = " native://nvid=f0ed2a6d7fb07688:5a342200:1265973105c:-7f46?USER "; bIsIdentity = ESS_TRUE; sts = EssListRequestsEx(hCtx, userId, bIsIdentity, "Sample", "Sample1", &numRequest, &requestInfo); printf("\nEssListRequestsEx sts: %ld\n", sts); printf ( "Total requests on the server: %d\n", numRequest ); if ( !sts && requestInfo ) { while ( index < numRequest ) { printf ( "login ID = %ul\n", requestInfo[index].LoginId ); printf ( "user name = %s\n", requestInfo[index].UserName ); printf ( "login machine = %s\n", requestInfo[index].LoginSourceMachine ); printf ( "AppName = %s\n", requestInfo[index].AppName ); printf ( "DbName = %s\n", requestInfo[index].DbName ); printf ( "DbRequestCode = %u\n", requestInfo[index].DbRequestCode ); printf ( "RequestString = %s\n", requestInfo[index].RequestString ); printf ( "TimeStarted = %ul\n", requestInfo[index].TimeStarted ); printf ( "State = %d\n", requestInfo[index].State ); printf ( "\n\n--------------------------------------\n\n", requestInfo[index].State ); sts = EssKillRequestEx (hCtx, &requestInfo[index] ); index++; } EssFree ( hInst, requestInfo ); } }
See Also