Question Logging Error 2624 and STOP Condition

KMoody

Member
OpenEdge Release: 10.2B07

When two users try to access the same record using EXCLUSIVE-LOCK, the second user gets the following popup message:

<file-name> in use by <user> on <tty>. Wait or choose CANCEL to stop. (2624)

Is there some way we can log when a user chooses CANCEL? Can we do this using an ON STOP condition?
 

Cringer

ProgressTalk.com Moderator
Staff member
Until OE 12 it's not possible to trap a STOP condition. A STOP is just that, a stop.
My question would be, why are you wanting to log this? And why aren't you handling this yourself?
Code:
FIND myrec EXCLUSIVE-LOCK NO-WAIT NO-ERROR. 
IF NOT AVAILABLE myrec THEN 
DO: 
  IF LOCKED (myrec) THEN 
  DO: 
    /* Handle locked record*/
  END.
  ELSE 
  DO:
    /* Handle not available record */
  END.
END.
 

KMoody

Member
In our most recent programs, we have handled exclusive locks ourselves. However, we have thousands of legacy programs that don't. If a user selects "CANCEL," the programs might do things we don't expect. If Progress could log this without requiring code changes, it could help us debug and improve our programs.
 
Last edited:

Cringer

ProgressTalk.com Moderator
Staff member
In our most recent programs, we have handled exclusive locks ourselves. However, we have thousands of legacy programs that don't. If a user selects "CANCEL," the programs might do things we don't expect. If Progress could log this without requiring code changes, it could help us debug and improve our programs.
Upgrade to OE12 and you can trap STOPS. You might even be able to do it in 11.7.4, but I'm not 100% certain.
 

RealHeavyDude

Well-Known Member
It is not exactly true that one cannot trap stop conditions pre-OE12.

This is what I use:

Code:
do on error undo, leave
    on stop undo, retry:

    /* STOP Condition trapped */
    if retry then do:

    end.

end.

I know it is not sexy - but it works for me.
 

andre42

Member
I agree with RealHeavyDude. This is what KMoody suggested in their question anyway, and what you had to do before structured error handling.
It is nice that Progress finally introduces -catchStop (I thought that they only did that with OE 12).

Some things about STOP errors are still broken IMO, though. If the procedure/program called by a run statement can't be found that is a stop error (which is a good thing IMO). If you run a procedure and the parameters don't match that is a plain error, not a stop. (IMO that's pretty bad, the error is arguably even worse than a non-existing procedure/program.) Both errors can be suppressed with no-error which may have some use for the first case (although you can probably check internal-entries for the existence of the procedure), but pretty bad for the second one.

Sorry for that rant since the question was only about find ... exclusive-lock resulting in a stop.
 
Top