ron
Member
Hi - I hope someone can help me.
I've used with the _Lock and other VST tables before without trouble - but I'm having a problem in a multi-DB environment using DICTDB. I have used DICTDB before - but not with VSTs.
I'm testing on a 9.1D environment (old, yes, but that's what I've been given - they're in the process of changing to 10.2).
The program I'm testing is a bit big, so I've extracted the problematic piece as follows:
When the program runs it is connected to three DBs: "TranMon", "dbase" and "dldb" (in that order).
If I run the test program with no records locked, the log shows:
CL: 17:20:17: Scanning locks for DB: dbase.
CL: 17:20:37: Scanning locks for DB: TranMon.
CL: 17:20:37: Scanning locks for DB: dldb.
CL: 17:20:37: Scanning locks for DB: dbase.
CL: 17:20:57: Scanning locks for DB: TranMon.
CL: 17:20:57: Scanning locks for DB: dldb.
CL: 17:20:57: Scanning locks for DB: dbase.
... which is what I expect.
But when I start locking records in another session - it ONLY displays that it sees a lock when I lock a record for the first database (TranMon), like this:
CL: 17:21:17: Scanning locks for DB: TranMon.
CL: 17:21:17: Found lock ID: 1.
CL: 17:21:17: Scanning locks for DB: dldb.
CL: 17:21:17: Found lock ID: 1.
CL: 17:21:17: Scanning locks for DB: dbase.
CL: 17:21:17: Found lock ID: 1.
However - it is reporting that is sees the lock for each DB - when in fact a record is only locked in Tranmon. If there are no records locked at all in TranMon - but records are locked in either or both of the other DBs - nothing is shown.
Either there is a bug in the code that I can't see - or DICTDB doesn't work for VSTs as I expect.
Can anyone explain my problem? Or, alternatively, explain another way that I can get at the VSTs of multiple databases?
Cheers,
Ron.
I've used with the _Lock and other VST tables before without trouble - but I'm having a problem in a multi-DB environment using DICTDB. I have used DICTDB before - but not with VSTs.
I'm testing on a 9.1D environment (old, yes, but that's what I've been given - they're in the process of changing to 10.2).
The program I'm testing is a bit big, so I've extracted the problematic piece as follows:
Code:
[FONT=courier new]DEF VAR db AS CHAR NO-UNDO.
DEF VAR i AS INT NO-UNDO.[/FONT]
[FONT=courier new]DEF STREAM logdata.[/FONT]
[FONT=courier new]OUTPUT STREAM logdata TO VALUE("/tmp/CL.log") UNBUFFERED.[/FONT]
[FONT=courier new]REPEAT:
IF SEARCH("/tmp/stop") <> ? THEN
LEAVE.
DO i = 1 TO 3:
ASSIGN db = LDBNAME(i).
IF db = ? THEN LEAVE.
CREATE ALIAS DICTDB FOR DATABASE VALUE(db).
/* Scan all locks for this DB */
[COLOR=#ff0000]RUN logit(INPUT "Scanning locks for DB: " + TRIM(STRING(db)) ).
[/COLOR] FOR EACH DICTDB._Lock NO-LOCK:
IF DICTDB._Lock._Lock-Table = ?
OR DICTDB._Lock._Lock-Usr = ? THEN LEAVE.
[COLOR=#ff0000]RUN logit(INPUT "Found lock ID: " + TRIM(STRING(DICTDB._Lock._Lock-Id)) ).
[/COLOR] END.
END.
PAUSE 20.
END.[/FONT]
[FONT=courier new]PROCEDURE logit.
DEFINE INPUT PARAMETER log-text AS CHAR FORMAT "x(90)".
DEF VAR msg AS CHAR FORMAT "x(99)".
ASSIGN msg = "CL: " + STRING(time,"HH:MM:SS") + ": " + log-text + ".".
PUT STREAM logdata UNFORMATTED RIGHT-TRIM(msg) SKIP.
END PROCEDURE.
[/FONT]
When the program runs it is connected to three DBs: "TranMon", "dbase" and "dldb" (in that order).
If I run the test program with no records locked, the log shows:
CL: 17:20:17: Scanning locks for DB: dbase.
CL: 17:20:37: Scanning locks for DB: TranMon.
CL: 17:20:37: Scanning locks for DB: dldb.
CL: 17:20:37: Scanning locks for DB: dbase.
CL: 17:20:57: Scanning locks for DB: TranMon.
CL: 17:20:57: Scanning locks for DB: dldb.
CL: 17:20:57: Scanning locks for DB: dbase.
... which is what I expect.
But when I start locking records in another session - it ONLY displays that it sees a lock when I lock a record for the first database (TranMon), like this:
CL: 17:21:17: Scanning locks for DB: TranMon.
CL: 17:21:17: Found lock ID: 1.
CL: 17:21:17: Scanning locks for DB: dldb.
CL: 17:21:17: Found lock ID: 1.
CL: 17:21:17: Scanning locks for DB: dbase.
CL: 17:21:17: Found lock ID: 1.
However - it is reporting that is sees the lock for each DB - when in fact a record is only locked in Tranmon. If there are no records locked at all in TranMon - but records are locked in either or both of the other DBs - nothing is shown.
Either there is a bug in the code that I can't see - or DICTDB doesn't work for VSTs as I expect.
Can anyone explain my problem? Or, alternatively, explain another way that I can get at the VSTs of multiple databases?
Cheers,
Ron.