Dead clients that do lock records

tsmit

New Member
Hello there,

We have a little problem someone may have had before.

We have a batch process witch does a FOR EACH table no-lock:

def buffer b-medi for medi.
def var i as int.

FOR EACH b-medi no-lock :
FIND medi of b-medi NO-WAIT NO-ERROR .

IF NOT AVAILABLE medi THEN DO:
IF LOCKED medi THEN NEXT.
END.
ELSE ASSIGN medi.medi-mutdat = TODAY.
END.

Can anybody tell me why as the loop encounters a record that is still locked by a user who has killed his session
(Ctrl-Alt-Delete or alike) Progress doesn't find it unavailable or locked?

Thanks in advance,

Ted
 
A

asorb

Guest
Hi, there...


Well, yeah... I also got sick enough of good-old-killed-users-locks!

I just ended having tables over which users don't lock anything up... anyway, if it's a batch procedure, it
probabily is for query activity only, isn't it?

Not that great solution, but... je.

Regards.

Message imported from PEG email list
 

Wilbert

New Member
Hi Ted,

If you try to find a record SHARE-LOCK or EXCLUSIVE-LOCK which is already locked, then the record is NOT available. So you should put an IF LOCKED before an IF NOT AVAILABLE.
In your case tou only need the IF LOCKED and can get rid of the IF AVAIL:

FOR EACH b-medi no-lock :
FIND medi of b-medi NO-WAIT NO-ERROR .

IF LOCKED medi
THEN NEXT.
ELSE ASSIGN medi.medi-mutdat = TODAY.
END.

HTH
 
Top