Lists all users who are connected to a specific application and database, together with a count of data blocks which they currently have locked.
Syntax
ESS_FUNC_M EssListLocks (hCtx, AppName, DbName, pCount, ppLockList);
Parameter | Data Type | Description |
---|---|---|
hCtx | ESS_HCTX_T | API context handle. |
AppName | ESS_STR_T | Application name. |
DbName | ESS_STR_T | databasename. |
pCount | ESS_PUSHORT_T | Address of variable to receive count of users. |
ppLockList | ESS_LOCKINFO_T | Address of pointer to receive an allocated array of user lock info structures. |
Notes
This function is a "snapshot", in that only those users who are connected to the server when this function is called will be listed.
The memory allocated for ppLockList should be freed using EssFree().
Return Value
If successful, returns a count of the number of connected users in pCount, and list of user lock structures in ppLockList.
Access
This function requires the caller to have database Design privilege (ESS_PRIV_DBDESIGN) for the specified database.
Example
ESS_FUNC_M ESS_ListLocks (ESS_HCTX_T hCtx, ESS_HINST_T hInst ) { ESS_FUNC_M sts; ESS_USHORT_T Count; ESS_PLOCKINFO_T plockinfo = NULL; ESS_STR_T AppName; ESS_STR_T DbName; AppName = "Sample"; DbName = "Basic"; sts = EssListLocks (hCtx, AppName, DbName, &Count, &plockinfo); if (!sts) { if (Count && plockinfo) EssFree (hInst, plockinfo); else printf ("\r\nExclusive Lock List on %s:%s is empty\r\n\r\n", AppName, DbName); } return (sts); }
See Also