Michael Lundberg · Feb 20, 2018

How to avoid the process to get stuck in a Queue?


We have problems in some productions where it stuck in a Queue when things goes wrong and i wonder if somebody have som tips to avoid it?

example when we got stuck is this:

set MyClass= ##class(SomeClass).%New(). MyClass has a Datefield

MyClass.Date =  Sourcedata.Date  //Sourcedata send us wrong format to that datefield. Error occur.


catch ex 
set tErrMsg = "Error i this method "  _ $System.Status.GetOneStatusText(ex.AsStatus())

In this case the catch-scope is not seems to be reached at all and the production get stuck in a Queue.

And this is pretty common for us also in operations if some request goes wrong.

Is there any common best practice to prevent or kill the queues?

Best regards,

Michael Lundberg

0 326
Discussion (5)1
Log in or sign up to continue

catch-scope is not seems to be reached

Have you enabled logging?

Error occurs on saving incorrect data and not on setting the data. Saving also does not throw an exception, only returns an error status.

Also you need to quit something:

#dim sc As %Status = $$$OK

  set myClass= ##class(SomeClass).%New()
  myClass.Date =  Sourcedata.Date  //Sourcedata send us wrong format to that datefield.
  set sc = myClass.%Save() // Error occurs on save.
} catch ex {
  set sc = ex.AsStatus()
  set errMsg = "Error in this method "  _ $System.Status.GetOneStatusText(sc)
quit sc

On a side note, you're using 3 different naming conventions for variables in your snippet:

  • tHungarianNotation
  • CapitalCase
  • lowercase

It would probably be better to decide on one notation.

Hi and thanks for answer. It's not any explicit saving. It seems to happens  immediately at allocation of the value even if there are more properties to set after that line. And there is of course a Quit later


How did you determine that problem happens directly at allocation (setting the property)?

I trace all lines and i never reach the line after (next property).  

Can you write


into a global? What's its value?