Re: DBMS_APPLICATION_INFO

From: Mark D Powell <Mark.Powell2_at_hp.com>
Date: Wed, 22 Feb 2012 09:46:57 -0800 (PST)
Message-ID: <804bbafb-397a-4275-8eab-9b198f4c6f19_at_m24g2000yqb.googlegroups.com>



On Feb 21, 2:06 pm, ExecMan <artme..._at_yahoo.com> wrote:
> On Feb 21, 12:50 pm, Peter Schneider <pschneider1..._at_googlemail.com>
> wrote:
>
>
>
>
>
> > Am 21.02.2012 16:04, schrieb ExecMan:
>
> > > Hi,
>
> > > We are using DBMS_APPLICATION_INFO to help track which procedures are
> > > running.  However, one issue we are having is when procedures call
> > > other procedures.
>
> > > For example, at the top of PROCEDURE_A we have this:
> > >     DBMS_APPLICATION_INFO.SET_CLIENT_INFO('PROCEDURE_A');
>
> > > And at the end of PROCEDURE_A we have this:
>
> > > DBMS_APPLICATION_INFO.SET_CLIENT_INFO(null);
>
> > > Now, say PROCEDURE_A calls PROCEDURE_B, then PROCEDURE_B has:
> > >     DBMS_APPLICATION_INFO.SET_CLIENT_INFO('PROCEDURE_B');
> > > .
> > > .
> > >     DBMS_APPLICATION_INFO.SET_CLIENT_INFO(null);
>
> > > That wipes out the value and when control is returned to PROCEDURE_A,
> > > there is no value set anymore.  So, this is great for a single
> > > procedure, but how can one integrate nested procedure calls and being
> > > able to use DBMS_APPLICATION_INFO more dynamically?
>
> > > Any thoughts or suggestions?
>
> > Write a wrapper around DBMS_APPLICATION_INFO and implement a stack; with calls
> > for push_and_set and pop_and_set...
>
> > Regards
> > Peter
>
> > --
> > The only way to keep your health is to eat what you don't want, drink what
> > you don't like, and do what you'd rather not. -- Mark Twain
>
> Not sure what you mean by "push_and_set and pop_and_set"- Hide quoted text -
>
> - Show quoted text -

Push and Pop are the standard terms used with stack management theory. You push entries onto the stack and pop them off. Normally a stack is last in first out as opposed to a queue which is FIFO, first in first out.

Anyway, what Peter, was suggesting is that you consider implementing your own procedure name tracing stack routine.

It really depends on it you need the complete call history recorded or you just need to know what a procedure is doing now.

How practical and useful this idea really is depends on your application and if you intend to code this into every procedure or just selected ones. Be careful you do not add a lot of unnecessary overhead to your code.

HTH -- Mark D Powell -- Received on Wed Feb 22 2012 - 11:46:57 CST

Original text of this message