EssListLocks() lists all users who are connected to a specific application and database, together with a count of data blocks which they currently have locked.
ESS_FUNC_M EssListLocks (hCtx, AppName, DbName, pCount, ppLockList);
| ESS_HCTX_T | hCtx |
| ESS_STR_T | AppName |
| ESS_STR_T | DbName |
| ESS_PUSHORT_T | pCount |
| ESS_PPLOCKINFO_T | ppLockList |
| hCtx | Essbase API context handle. |
| AppName | Application name. |
| DbName | databasename. |
| pCount | Address of variable to receive count of users. |
| ppLockList | Address of pointer to receive an allocated array of user lock info structures. |
If successful, returns a count of the number of connected users in pCount, and list of user lock structures in ppLockList.
This function requires the caller to have database Design privilege (ESS_PRIV_DBDESIGN) for the specified database.
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);
}