Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

db handles with fork()
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
----------------------------------------------------------

Report this thread to moderator Post Follow-up to this message
Old Post
Ramprasad A Padmanabhan
03-30-05 08:56 PM


RE: db handles with fork()
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.

Report this thread to moderator Post Follow-up to this message
Old Post
Bob Showalter
03-30-05 08:56 PM


Re: db handles with fork()
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?


Report this thread to moderator Post Follow-up to this message
Old Post
jk77
03-30-05 08:56 PM


RE: db handles with fork()

> 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
----------------------------------------------------------

Report this thread to moderator Post Follow-up to this message
Old Post
Ramprasad A Padmanabhan
03-30-05 08:56 PM


Re: db handles with fork()
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

Report this thread to moderator Post Follow-up to this message
Old Post
Felix Geerinckx
03-31-05 08:57 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:04 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.