Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: C program and stored procedure
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
![]() |
![]() |