EssListLocks

Description

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.

Syntax

ESS_FUNC_M EssListLocks (hCtx, AppName, DbName, pCount, ppLockList);
ESS_HCTX_ThCtx
ESS_STR_TAppName
ESS_STR_TDbName
ESS_PUSHORT_TpCount
ESS_PPLOCKINFO_T ppLockList

Parameters

hCtxEssbase API context handle.
AppNameApplication name.
DbNamedatabasename.
pCountAddress of variable to receive count of users.
ppLockListAddress of pointer to receive an allocated array of user lock info structures.

Return Value

If successful, returns a count of the number of connected users in pCount, and list of user lock structures in ppLockList.

Notes

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

EssListConnections()
EssListUsers()
EssRemoveLocks()