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:
Gary Nolan <[log in to unmask]>
Reply To:
Gary Nolan <[log in to unmask]>
Date:
Mon, 27 Apr 1998 09:14:47 -0300
Content-Type:
text/plain
Parts/Attachments:
text/plain (164 lines)
Sorry my mistake the password problem is a typo. The example was copied from a test and I had to change it a little bit in the original both passwords are the same.

Also the reason the "loop 1" message gets displayed is the program makes one pass through getting the status 22 an the on the second pass the error message occurs.

Thanks for the help
Gary Nolan

-----Original Message-----
From:   Costas Anastassiades [SMTP:[log in to unmask]]
Sent:   April 25, 1998 7:22 AM
To:     [log in to unmask]
Cc:     'Gary Nolan'
Subject:        RE: Transact logtran error

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