Kbase P100617: What kind of user is locking a record from a particular table?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  3/27/2009 |
|
Status: Verified
GOAL:
What kind of user is locking a record from a particular table?
GOAL:
Record Locking - How to get all the information from _lock, _file, _connect VST?
GOAL:
How to find out who has a particular record locked through the use of Virtual System Tables (VST).
GOAL:
How to know who has locked the record using VST?
FACT(s) (Environment):
All Supported Operating Systems
Progress 9.x
OpenEdge 10.x
FIX:
You have to implement a code that uses the VST table: _lock, _file, _connect. Here you are a simple sample that for each lock give you, on top of the information of promon, the user PID and the table name.
DEFINE VARIABLE my-title AS CHARACTER NO-UNDO.
my-title = string(TODAY) +
" Status: Lock Table " +
string(TIME, "HH:MM:SS").
DEFINE TEMP-TABLE tt_lock LIKE _lock.
for each _Lock NO-LOCK:
IF _Lock-Usr <> ? THEN DO:
CREATE tt_lock.
BUFFER-COPY _lock TO tt_Lock .
END.
ELSE LEAVE.
END.
for each tt_lock NO-LOCK,
FIRST _file WHERE tt_lock._Lock-Table = _file-number NO-LOCK,
FIRST _Connect WHERE _Connect-usr = tt_lock._Lock-Usr NO-LOCK:
display SKIP(1)
tt_lock._Lock-Id COLUMN-LABEL "Lock Id" FORMAT ">>>>9"
_Connect-usr COLUMN-LABEL "Usr"
_Connect-Name COLUMN-LABEL "UsrName"
_Connect-Type COLUMN-LABEL "UsrType"
_Connect-Pid column-LABEL "UsrPid" FORMAT ">>>>9"
tt_lock._Lock-Name COLUMN-LABEL "Name"
tt_lock._Lock-Table COLUMN-LABEL "tableNum"
_file-name COLUMN-LABEL "table"
tt_lock._Lock-Type COLUMN-LABEL "Type"
tt_lock._Lock-Recid COLUMN-LABEL "RECID"
tt_lock._Lock-Chain COLUMN-LABEL "Chain"
tt_lock._Lock-Flags COLUMN-LABEL "Flags"
with frame Lock-All-frame
DOWN
TITLE my-title.
 .; end.
PAUSE ..