Get STACK of another process

Hi,

How can I read the stack of another process?

I know about ^JOBEXAM, but I only know how to use through terminal, and I need to get a string, or at least do a method that returns me a string

For example:

I have process A and B

B monitors process A at each second.

B logs information about process A in a table

Informations about lock I get through %SYS.LockQuery and the process through %SYS.Process

How can I get stack of process A from process B to log in the table?

Cache 2015.2.1

 

Thanks

 

  • 0
  • 0
  • 313
  • 1
  • 1

Answers

Since no one answered that yet, maybe there isn't a known way of doing it.
If that's really the case, I suggest you to create your procedure.

This could work as the following:
 

1 - Routine B watches a global generated from Routine A using a scheduled task.

2 - Process A triggers an exception.

3 - Exception on routine A executes subroutine or method to that uses $stack to capture execution data.

4 - Routine A stores data into a global and quits abnormally.

5 - Routine B watches for new entries in the global, marks it as used/processed.

Hi Rubens,

Thank you for your reply.

The idea was just monitor locks to identify which locks were made by each routine and gets its respective stack, without throwing an exception.

Sometimes we get some lock errors while manipulating persistent classes, and the cause is that other process holds a lock for too long, but we don't have how to identify the reason unless we run ^JOBEXAM right before the error happens