Subject Re: Is there a way for a stored procedure to know its own name ?
Author olivier_lucaes
--- In firebird-support@yahoogroups.com, "Alan McDonald" <alan@...>
wrote:
>
> > Dear all,
> >
> > I'm trying to find an issue that happens time to time (2 times per
> > month) that triggers the crash of the firebird server. The server
is a
> > superserver, version 1.5.2 running on a Linux box. There are
usually 5
> > users working on 5 five different clients during the day.
> > I have around 350 stored procedures. In my application, there are
only
> > few read access that are done out of the scope of the stored
> > procedures. Last time this happened, this was somehow easy to
> > reproduce therefore I found it easily.
> > This time, I have no clue what could cause the issue and it is not
> > easy to recognize which client has really triggered the error.
> > Therefore I would like to insert a kind of debugging message in
all
> > procedures. I would call at the beginning and at the end a new
stored
> > procedure that would get the calling procedure name in parameter.
> > In order to insert by copy and past a piece of code I wanted to
know
> > if the name of the procedure is available in any reserved word,
> > built-in function or so ?
> > If anyone has any idea how to debug this king of error (I can not
> > reproduce the 'productive' activity on my test version...), I'm
opened
> > to any hint.
> > Unfortunately I don't have the exact message found in the firebird
> > log, but it is the same that I used to have when there was a data
> > overflow. It just mentions that the server crashes and that it is
> > restarted.
> > Thanks and best regards
> > Olivier
>
> forgot another debug method:
> set a debug value in all SPs
> create an external table
> use insert into external_table... etc
> plenty of times in your SPs when debug value is set/sot set
> when the server crashes, the steps after the last log even in the
external
> table are the reason for the crash (maybe).
> external tables don't suffer from rollback so the entries are
permanent.
> Alan
>
Hi Alan,
that was somehow my intention (to identify the SP : 1 call at
begining, 1 call at the end) but the idea of the external table is
very good : i did not know how to manage the rollback of the log
table due to the crash.
Again, is there any way for a SP to find its own name (built in
function ? reserved word ?,...) ?

Thanks again
best
Olivier