Re: forking destroys db connection

2002-12-03 Thread Michael A Chase
On Mon, 2 Dec 2002 14:44:28 -0500  Daniel Quan [EMAIL PROTECTED] wrote:

 I am using the latest version of DBI and oracle 8i.
 
 When my code forks and child exits it destroys the parent's connection to
 the database.
 I found some excerpt in working around the problem.
 One of the solution was InactiveDestroy set to 1.
 This did not solve the problem.
 
 Stuart Hughes suggested using syscall(Sys_exit,0)..in Solaris.
 My problem happens in IBM AIX and don't have syscall.h.

Look at InactiveDestroy in 'perldoc DBI', it should be set to 1 in the
child to prevent the connection from being destroyed when the child exits. 
I normally try to avoid having any open handles when I fork().  You
generally can't use a handle created in the parent in the child, but it
does get copied into the child's memory space and the reference goes out of
scope when the child exits.

-- 
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.






Re: forking destroys db connection

2002-12-03 Thread Michael A Chase
On Tue, 3 Dec 2002 12:44:51 -0500  Daniel Quan [EMAIL PROTECTED] wrote:

 thanks for replying..
 I have tried InactiveDestroy =1.
 It does not work.
 The exit in the child after fork literally destroys the
 DB handle in parent.

Something else is happening then, InactiveDestroy has worked for others for
several years.  What you describe is exactly what InactiveDestroy should
prevent.  Are you trying to use the handle in the child process?

Example code that demonstrates the problem would make it much easier for
someone to help you.

 -Original Message-
 From: Michael A Chase [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, December 03, 2002 12:44 PM
 To: '[EMAIL PROTECTED]'; Daniel Quan
 Subject: Re: forking destroys db connection
 
 
 On Mon, 2 Dec 2002 14:44:28 -0500  Daniel Quan [EMAIL PROTECTED]
 wrote:
 
 I am using the latest version of DBI and oracle 8i.
 
 When my code forks and child exits it destroys the parent's connection to
 the database.
 I found some excerpt in working around the problem.
 One of the solution was InactiveDestroy set to 1.
 This did not solve the problem.
 
 Stuart Hughes suggested using syscall(Sys_exit,0)..in Solaris.
 My problem happens in IBM AIX and don't have syscall.h.
 
 Look at InactiveDestroy in 'perldoc DBI', it should be set to 1 in the
 child to prevent the connection from being destroyed when the child exits. 
 I normally try to avoid having any open handles when I fork().  You
 generally can't use a handle created in the parent in the child, but it
 does get copied into the child's memory space and the reference goes out of
 scope when the child exits.

-- 
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.