Hi Tielman,
I had exactly the same problem (I asked about it about 2 weeks ago).
I use Oracle though. Even if you don't use the handle from the mother in the child,
the handle still gets fucked up. The child will try to close your handle.
There is a modifier called InactiveDestroy, like:
$db->{InactiveDestroy} = 1;
This supposedly will ensure that your handle isn't closed when the child exist.
It sure doesn't close the connection but it doesn't work for me. The parent handle is
just KAPUT. But this is Oracle, not Informix. It might work for you.
I have given up to it. I now close and open all database handles again and again and
again.
PS I don't know how your forking is implemented but I sure hope that you don't need to
know any exit values from your children. I have noticed it's *very* unreliable to
depend on waitpid.
Again, your milage may vary as this Oracle. I know use pipes to communicate between
processes.
Jeroen
>
> Thanks John,
>
> But the idea here is that the child doesn't need a handle at all -- I
> just want the mother's handle to be "left alone" ...
>
> Tielman
>
>
> On Tue, 07 Oct 2003 09:09:58 -0400, John Saylor wrote:
>
> > hi
> >
> > no- fork YOU and die ...
> >
> > ( 03.10.07 12:31 +0100 ) tvilliers:
> >> I have a mother process which needs to fork off a child at every x
> >> milestone.
> >> Now, the mother has an open database handle, which from my
> understanding
> >> gets transferred to the child at fork. I want the handle
> to stay with the
> >> mother.
> >
> > why not have the child just create it's own handle? i'm no
> dba [but i
> > play one on the internet], but i've seen informix
> connection lists that
> > use PID for identifying the handles.
>