[Israel.pm] Weird problem with DB connection & forking...
yuval at windax.com
Tue May 18 05:43:02 PDT 2004
Pinkhas Nisanov wrote:
>On Tue, 2004-05-18 at 15:12, Yuval Yaari wrote:
>>This really worked well on the old machine but on the new machine it
>>says "DBD::mysql::db selectrow_array failed: MySQL server has gone away
>>at..." when I try to selectrow_array.
>Somewhere in DBI man page I saw that DBI connection
>sometimes do not survive fork, so after fork you
>need to reconnect to DB, better way do not use father's
>dbi handler, create new one for child.
This is exactly how I solved the problem.
I'm looking at "InactiveDestroy" under "ATTRIBUTES COMMON TO ALL HANDLES"...
So probably this is the problem - thanks for pointing this out!
More information about the Perl