Re: Prob with Pro*C and signal hand. func.

From: Joe Halpin <jhalpin_at_netcom.com>
Date: Tue, 30 Aug 1994 11:08:39 GMT
Message-ID: <jhalpinCvCHMF.6x5_at_netcom.com>


In article <33t2iv$is0_at_blackice.winternet.com> heilja_at_winternet.com (Joseph Heil) writes:
> I have been having problems updated a table in a pro*c app. I have
> a signal handling function to catch a child processes termination
> (sigchld). First in the function i call wait to return the pid of
> the child, then call the signal(SIGCHLD,myfunc) again to turn the
> handler back on, and then try to update a table in oracle from
> the signal handling function. I theory this should work fine, but
> I get a ora-3106 error about 25% of the time. After talking to
> oracle they said that pro*c,sql and oracle does not support such an
> idea, that is to call a embedded statement from the signal handling
> function. Anybody have any ideas? Some more info on the problem,
> this is a async process, monitoring a table for changes, then spawning
> new process when a flag is set. When the child dies I need to
> update the status of that record with a timestamp and other info.

One possibility might be to establish a pipe between the parent and child process, and have the child notify the parent of completion through the pipe, which would get you out of the signal handler (you still should catch SIGCHLD, of course).

Another possibility would be to have the signal handler update a global flag, and check the flag in the main loop.

-- 
Joe Halpin 
jhalpin_at_netcom.com
---------------------------------------------------------------------------
Received on Tue Aug 30 1994 - 13:08:39 CEST

Original text of this message