EssKillRequestEx

Terminates specific Essbase user sessions or requests. Similar to EssKillRequest, but the input structure can include user directories and unique identity attributes.

Syntax

ESS_FUNC_M EssKillRequestEx (hCtx, pRequestInfoStruct);
ParameterData TypeDescription

hCtx

ESS_HCTX_T

API context handle (input).

pRequestInfoStruct

ESS_PREQUESTINFOEX_T

Pointer to the Request Information structure (input).

Notes

This function uses the information in ESS_REQUESTINFOEX_T regarding current sessions and requests to terminate a specific user session. This function can also be used to terminate (without logging out the user) any active requests being made to an application, a database, or the system during a user session.

A session is the time in seconds between an Essbase 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.

This function terminates the sessions/requests specified by the UserName, AppName, and DbName specified in the ESS_REQUESTINFOEX_T structure. If those fields are null, this function terminates all sessions/requests initiated by this process (user). The application program is responsible for allocating and freeing the memory used by ESS_REQUESTINFOEX_T.

Return Value

Returns zero if successful; error code if unsuccessful.

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

  • EssListRequestsEx