Kbase P16887: How to identify users with long running transactions.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/15/2006 |
|
Status: Verified
GOAL:
How to identify users with long running transactions.
GOAL:
How to list connected users involved in with transactions.
FIX:
The following 4GL code lists all active transactions that are older than two minutes (120 seconds) along with their user numbers and time duration:
DEFINE VARIABLE iTimeInSeconds AS INTEGER NO-UNDO INITIAL 120.
FOR EACH _Trans WHERE _Trans._Trans-State EQ "Active" AND
_Trans._Trans-Duration GT iTimeInSeconds NO-LOCK:
DISPLAY _Trans-Num _Trans-UsrNum _Trans-Duration.
END.
The following variation also lists the users names:
DEFINE VARIABLE iTimeInSeconds AS INTEGER NO-UNDO INITIAL 120.
FOR EACH _Trans WHERE _Trans._Trans-State EQ "Active" AND
_Trans._Trans-Duration GT iTimeInSeconds NO-LOCK:
FIND FIRST _Connect WHERE _Connect._Connect-Usr = _Trans._Trans-UsrNum NO-LOCK NO-ERROR.
DISPLAY _Trans-Num _Trans-UsrNum _Trans-Duration _Connect._Connect-Name.
END.