HP3000-L Archives

April 1998, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Costas Anastassiades <[log in to unmask]>
Reply To:
Costas Anastassiades <[log in to unmask]>
Date:
Sat, 25 Apr 1998 10:21:54 +-300
Content-Type:
text/plain
Parts/Attachments:
text/plain (150 lines)
Gary, it's all Greek to me but I'll throw my 2 Drachmas worth in :) ...

Something is very strange here. I think the root cause is the fact that in
all probability you have specified the wrong database password in LOCK02.
(i.e. it should read UPDATA and not UPDATE). Of course that's assuming
you've posted the actual example and not just re-typed it, but still
doesn't explain the programs behavior. I don't see how the "Loop>1" message
gets displayed *before* the Logrtran error message.

As another test, I'd try and "solidify" (?) the code by removing the LEVEL
commands, getting the STATUS value earlier and using MYSTAT in place of
STAT as STAT is a compiler option :

A000-START:
    LIST LOOP,INIT:
         MYSTAT,INIT;

    SET(OPTION) NOLOCK;
    SET(OPTION) NOHEAD;

    LET(LOOP) = 0;

A100:
    LET (LOOP) = (LOOP) + 1;
    DISPLAY "Loop=":LOOP;

    LOGTRAN(BEGIN) $HOME,"STARTING LOCK",
                   LOCK(SET-A,
                        SET-B,
                        SET-C),STATUS;

    LET (MYSTAT) = STATUS;
    DISPLAY
      "Status=": MYSTAT;

    IF (MYSTAT) <> 0 THEN
      GO TO A100;

    LOGTRAN(END) $HOME,"END LOCK";
    RESET(OPTION) NOLOCK;
    EXIT;

Having said all this, I'd like to point out that I've never used LOGTRAN to
LOCK a DB :))

Costas Anastassiades,
Athens-Greece

----------
From:   Gary Nolan[SMTP:[log in to unmask]]
Sent:   Παρασκευή, 24 Απριλίου 1998 10:02 μμ
To:     [log in to unmask]
Subject:        Transact logtran error

Hi Folks,
A message to anyone using transaction locking in Transact. There appears to
be a problem with the status checking.
Example:
Program Lock01 locks one of the data set and runs in another session.
Program Lock02 tries to lock 3 data sets one of which is the set held by
Lock01.
The lock02 program gets lock on the first data set but cannot get second
set so it returns a status of 22 the program then loops for a second
attempt to lock and even though the data set is still locked  the status is
returned as 0 and the program assumes that a lock has been granted but it
has not.

Here are samples I used to test this. I am on 5.5 express 4. This problem
has been reported to HP and a SR submitted but the lab is back logged and
unable to look at problem until June?.
Anyone have any Ideas?

SYSTEM LOCK01,
       BASE=mybase("UPDATA",1,1);

A000-START:
    LEVEL;

    SET(OPTION) NOLOCK;
    LOGTRAN(BEGIN) $HOME,"STARTING LOCK",
                   LOCK(SET-B);

    INPUT "PRESS RETURN TO STOP";

    LOGTRAN(END) $HOME,"END LOCK";
    RESET(OPTION) NOLOCK;

    END(LEVEL);
    EXIT;


SYSTEM LOCK02,
       BASE=mybase("UPDATE",1,1);

DEFINE(ITEM) LOOP                       I(9):
             STAT                       I(9);

A000-START:
    LIST LOOP,INIT:
         STAT,INIT;


    DISPLAY "STARTING LOCK";

    SET(OPTION) NOLOCK;
    LEVEL;
    LOGTRAN(BEGIN) $HOME,"STARTING LOCK",
                   LOCK(SET-A,
                        SET-B,
                        SET-C),STATUS;

    LET (LOOP) = (LOOP) + 1;
    LET (STAT) = STATUS;

    DISPLAY
      "Loop>":
       LOOP,NOHEAD:
      "Status>":
      STAT,NOHEAD;

    IF STATUS <> 0 THEN
        DO
        END;
        DOEND;

    END(LEVEL);
    DISPLAY "GOT LOCK";
    LOGTRAN(END) $HOME,"END LOCK";
    RESET(OPTION) NOLOCK;
    EXIT;


<PUB>:RUN LOCK02

STARTING LOCK
Loop> 1          Status> 22

*ERROR: DBLOCK FAILED AS LOGTRAN LOCKS ARE STILL ACTIVE.  (TXC 86) [0.10]
[LOCK0
1]
Loop> 2          Status> 0
GOT LOCK

END OF PROGRAM

Gary Nolan
Sydney Steel Corporation
E-mail [log in to unmask]
Ph (902) 564-7982

ATOM RSS1 RSS2