Consultor Eletrônico



Kbase P103708: How to gather information from the _Lock table when connected to multiple databases?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Unverified

GOAL:

How to gather information from the _Lock table when connected to multiple databases?

GOAL:

Reading the _Lock table from a session connected to several databases

GOAL:

Is there a _lock table per database?

FIX:

The _Lock table is initialized when starting the Database Broker; there is one _Lock table per database.

Let's assume you connected to 3 databases with, for example the command:
mpro -db sports -db sports1 -S 8888 -db sports2 -S 9999
with "sports" being a local database

Below a 4GL program to see which user(s) is(are) locking recid 385.
FOR EACH sports._Lock WHILE sports._Lock._Lock-Id <> ?:
IF sports._Lock._Lock-Recid = 385 THEN DO:
DISPLAY sports._Lock._Lock-Usr sports._Lock._Lock-Name.
MESSAGE ("in sports").
LEAVE.
END.
END.
MESSAGE("Checking second DB").
FOR EACH sports1._Lock WHILE sports1._Lock._Lock-Id <> ?:
IF sports1._Lock._Lock-Recid = 385 THEN DO:
DISPLAY sports1._Lock._Lock-Usr sports1._Lock._Lock-Name.
MESSAGE ("in sports1").
LEAVE.
END.
END.
MESSAGE("Checking third DB").
FOR EACH sports2._Lock WHILE sports2._Lock._Lock-Id <> ?:
IF sports2._Lock._Lock-Recid = 385 THEN DO:
DISPLAY sports2._Lock._Lock-Usr sports2._Lock._Lock-Name.
MESSAGE ("in sports2").
LEAVE.
END.
END.