), so it is already closed.
Regards,
Dwight
-Original Message-
From: Chris Verges [mailto:[EMAIL PROTECTED]
Sent: Saturday, April 21, 2007 12:21 PM
To: php-db@lists.php.net
Subject: [PHP-DB] Forking and database connections
Hey all,
I'm writing a PHP script that queries a database
To: 'php-db@lists.php.net'
Subject: RE: [PHP-DB] Forking and database connections
http://php.he.net/manual/en/function.pcntl-fork.php says 'The reason for
the MySQL Lost Connection during query...' like what you concluded,
although they grab a new $db connection in the first for loop
} else
and execute.
Regards,
Dwight
-Original Message-
From: Dwight Altman [mailto:[EMAIL PROTECTED]
Sent: Monday, April 23, 2007 10:09 AM
To: 'php-db@lists.php.net'
Subject: RE: [PHP-DB] Forking and database connections
http://php.he.net/manual/en/function.pcntl-fork.php says
:01 PM
To: Dwight Altman; php-db@lists.php.net
Subject: Re: [PHP-DB] Forking and database connections
Hey Dwight,
Thanks for the replies! When the first child thread closes, all of the DB
connections seem to close. That is, the $db-execute() statements will
fail
in the child threads
To use a PEAR::DB persistent connection, try
$db = DB::connect($dsn, TRUE);
or
$db = DB::connect($dsn, true);
Googled for pear::db persistent connection and got
http://vulcanonet.com/soft/?pack=pear_tut
Regards,
Dwight
-Original Message-
From: Dwight Altman [mailto:[EMAIL PROTECTED]
Hey Dwight,
After getting your first e-mail, I started adding the PEAR::DB persistent
connection code. Unfortunately, it yielded the same results that I was
getting before.
At a hunch, I created a second proof-of-concept script that uses the mysql_*
functions in the PHP base. For each of
For anyone interested in following the progress of this forking/PEAR::DB
issue, see http://pear.php.net/bugs/bug.php?id=10813.
Thanks,
Chris
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Glad to help.
I was actually interested in your post because of forking versus threading.
I still haven't found anything except for PHP-GTK but it may help your
database related performance if it is added/exists in PHP.
Regards,
Dwight
-Original Message-
From: Chris Verges
Hey all,
I'm writing a PHP script that queries a database for some records, splits
the records into N number of groups of equal size, and then creates N number
of forks where each child handles one of the groups. During the execution
of each of the child processes, I'd like the parent process to