Stefan Drissen (Exact) asked a question.
When is STOP / Cancel-Requests acknowledged by PASOE?
I have an issue, which I can only (for now) reason as being caused by some form of STOP being listened to in a multi-variable assign.
- assign
- var1 = 'one'
- // can STOP get in between these two?
- var2 = 'two'
- .
Which stop do you suspect is causing this? A system error? Trimming of a PASOE session?
I suspect some form of timeout.
The session is still alive, but with var1 updated, but var2 is not.
The variables impacted have session state responsibility (in a static class).
"can STOP get in between these two?"
Certainly. A programmatic STOP can be demonstrated by changing your code so that it is:
Run the above as is, then change the initialization of timetostop = yes.
Are you catching STOP in this code?
Most causes for a STOP are trappable; there are a very few which are not trappable (a hard STOP) -- for example, a database connection is lost (db admin disconnects you) causes a hard STOP; in that case, the hard STOP turns into a soft STOP as soon as all procedures/objects that depend on the database are off the call-stack and/or otherwise destroyed.
If the ABL Session that is running your code receives an administrative hard STOP, your ABL Session will be reset (static classes destroyed).
If it's a soft STOP (trappable), then you should be able to catch it.
If it's an Administrative Terminate with option INTERRUPT, then you won't be able to catch the STOP and the ABL Session (with its static class instances) will be destroyed, so it shouldn't matter.
Thank you, your explanation made excellent sense, until I tried it and it is only confusing me more:
Even though the first getVal call executed a stop, the second call is performed (message: 2).
The values of both var1 and var2 are then unknown.
But var3 which is assigned a constant does have a value (final message: ? ? 3)
Add a Catch for the Progress.Lang.Stop and you'll see only message "1", and the final message with all 0's. So that shows that starting with the line where the stop happens, the assign aborts and does not change the variables' values.
And for fun/more confusion, a traditional ON STOP UNDO, LEAVE block will not handle a stop condition in the middle of a multi-assign. But it can cause a catch to be bypassed.
Updated code to demonstrate: