On Fri, Feb 09, 2001 at 04:18:00PM -0500, Baxter, Lincoln wrote:
> Actually, the oracle connection is 'disconnected' in the parent before the
> child is created. (I am NOT trying to carry the connection across a fork)
> The oracle database is then RE-connected in the child, and works JUST FINE.
>
> The problem is the socket connection to the client is trashed. (Only after
> oracle is accessed). If I do not open an oracle connection in the child,
> then the client connection socket is fine. It's almost like DBD/Oracle
> closes the client's socket, and then reuses it for the database connection.
> Then when the database connection is closed, (after the child has done its
> work), when the child writes the results back to the client, the client's
> socket is invalid. (I get an IO error). This does not happen, when I run
> in NON-forking mode. (single process/no subservers)
>
> I have come up with a workaround, which is to fork a child to do my
> startup tests... which child then just exits when it is done. The parent
> waits for the child to exit, and checks the exit status before
> continuing. This keeps the parent unpolluted, for the real work.
>
> The reason I brought this up is that DBI or Oracle (which ever) *shouldn't*
> be trashing unrelated com channels... its almost like there is a hard coded
> file number somewhere in the DBD oracle code, or something it calls.
I'm quite certain that it's nothing in DBI or DBD::Oracle. You could
use a system-call tracing tool (like truss or strace, but I think it
has a different name on HPUX) to see what's actually happening behind
the scenes.
Tim.
> Lincoln
>
>
> -----Original Message-----
> From: Stephen Clouse [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 09, 2001 3:54 PM
> To: Baxter, Lincoln
> Cc: dbi-users
> Subject: Re: internet socket trashed in child when DBI called first in
> parent
>
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Fri, Feb 09, 2001 at 01:58:36PM -0500, Baxter, Lincoln wrote:
> > Hi,
> >
> > I have a daemon (using Net::Daemon) that uses DBI/DBD-Oracle in forked
> > children of the daemon.
> >
> > When a client connects the daemon forks a child that then connects to the
> > database via DBD-Oracle.
> >
> > Recently I decided to check all the database connections in the parent
> > during startup, and this creates a problem:
> >
> > The DBD-Oracle connnection works fine after the child is forked
> > BUT, the socket on which I was connected to the client is trashed
> >
> > I tried setting InactiveDestroy=>1 in my connect call, but this did
> > not fix it. Has anybody seen this kind of problem?
>
> I believe Oracle screws up something fierce if you try sharing a connection
> between a parent and spawned children. Or am I not properly following the
> last
> half of the question...
>
> - --
> Stephen Clouse <[EMAIL PROTECTED]>
> Senior Programmer, IQ Coordinator Project Lead
> The IQ Group, Inc. <http://www.theiqgroup.com/>
>
> -----BEGIN PGP SIGNATURE-----
> Version: PGP 6.5.8
>
> iQA/AwUBOoRY2gOGqGs0PadnEQJvdgCeL5fcxicZamlKaKB18grjQnN//ZYAniax
> N7h/86emMjntvse0gal349gi
> =0SgY
> -----END PGP SIGNATURE-----