Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: C program and stored procedure

Re: C program and stored procedure

From: Ed Prochak <edprochak_at_interfacefamily.com>
Date: 1998/04/06
Message-ID: <35297CF7.4AF1@interfacefamily.com>#1/1

simona cruciani wrote:
>

 [snip]
> The host program calls a stored procedure with these instructions:
> EXEC SQL EXECUTE
> BEGIN
> procedure;
> END;
> END-EXEC;
>
> When we kill the program, the stored procedure doesn't die. Why?
>
> There is any way to kill the stored procedure when the calling program
> dies??
>

Are you on a unix platform? How are you killing the process? If you use

 kill -9 <pid>

you lose. That's because the -9 signal is an immediate kill. The process is given no chance to clean up after itself. Since the stored procedure is not a child process of your process, it does not get killed. I'm not a DBA, but you will have to kill the procedure via an Oracle mechanism. (At worst case, shut down and restart the instance.) The Kill -9 can leave lots of stuff hung in the DB, like procedures or table locks.

Next time use another signal, like -1 which gives the process a chance to close its connections. The one I always try first is the hang up signal. I forget its numeric value because I use the symbolic command line value -HUP. TTry that next time:

  kill -HUP <pid>

and your system will be glad you did. Received on Mon Apr 06 1998 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US