| Author |
db handles with fork()
|
|
| Ramprasad A Padmanabhan 2005-03-30, 3:56 pm |
| Hi,
I am writing a perl application that connect to a database and then
does a fork()
The child completes the process and does a exit(), but the problem is it
closes the database connection which the parent would like to use.
Can I exit the child process without disconnecting the parent dbi handle
Thanks
Ram
----------------------------------------------------------
Netcore Solutions Pvt. Ltd.
Website: http://www.netcore.co.in
Spamtraps: http://cleanmail.netcore.co.in/directory.html
----------------------------------------------------------
| |
| Bob Showalter 2005-03-30, 3:56 pm |
| Rampra A Padmanabhan wrote:
> Hi,
> I am writing a perl application that connect to a database and then
> does a fork()
> The child completes the process and does a exit(), but the problem is
> it closes the database connection which the parent would like to use.
>
> Can I exit the child process without disconnecting the parent dbi
> handle
I would strongly recommend you connect after the fork. Each process needs to
have its own connection.
| |
|
| I agree with Bob. Why do you want the parent process to handle the
database connection. What is the purpose of the child process after
the fork?
| |
| Ramprasad A Padmanabhan 2005-03-30, 3:56 pm |
|
> I would strongly recommend you connect after the fork. Each process needs to
> have its own connection.
Thanks for the reply.
Even I had thought so, probably for efficiency I can use dbi
cached_connect
Ram
----------------------------------------------------------
Netcore Solutions Pvt. Ltd.
Website: http://www.netcore.co.in
Spamtraps: http://cleanmail.netcore.co.in/directory.html
----------------------------------------------------------
| |
| Felix Geerinckx 2005-03-31, 3:57 am |
| On 30/03/2005, Rampra A Padmanabhan wrote:
> I am writing a perl application that connect to a database and then
> does a fork()
> The child completes the process and does a exit(), but the problem is
> it closes the database connection which the parent would like to use.
>
> Can I exit the child process without disconnecting the parent dbi
> handle
Have you read the 'InactiveDestroy' entry in perldoc DBI?
--
felix
|
|
|
|