Re: forking problem with dbd::mysql 

-----Original Message-----
>From: Jeremy Kister 
>Sent: May 10, 2007 12:17 AM
>To: beginners@perl.org
>Subject: Re: forking problem with dbd::mysql
>
>On 5/9/2007 11:12 AM, Chas Owens wrote:
>> my $dbh = DBI->connect($dsn, $dbun, $dbpw, {RaiseError => 1});
>> 
>> to
>> 
>> my $dbh = DBI->connect(
>>     $dsn, $dbun, $dbpw,
>>     {
>>         RaiseError => 1,
>>         mysql_auto_reconnect => 1
>>     }
>> );
>
>Yes, that works, just as a regular my $dbh = DBI->connect() inside the
>loop, before the SELECT.
>
>The problem is, in reality, my real code doesnt sleep in the loop, and
>reconnecting each time would be quite intensive.
>
>
>FYI, I found that when using DBD::Sybase, the problem does not exist.
>
>Should I take this over to the mysql-perl list ?
>
>Thanks!


What I think is instead of obtaining the $dbh from parent,you would better re-create a dbh object in child after forking.

--
mailto:pangj@earthlink.net
http://home.arcor.de/jeffpang/

-- 
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/


