in reply to Re: Re: Re: DBD::mysql with a forked processes caused lost MySQL connection unless mysql_auto_reconnect is set?
in thread DBD::mysql with a forked processes caused lost MySQL connection unless mysql_auto_reconnect is set?

Ahhh, so...

I should be able to fix this by simply moving the use inside of the fork? That doesn't seem to work. I guess even if the use is inside of wakeup() it's still being compiled before forking? Seems I'm a bit confused on what's happening under the covers when forking. Time to do some reading, any suggestions?

or I can move the db connection call out of the "main" section of TEST.pm. That does work.

Cool, thanks for the help perrin.

  • Comment on Re: Re: Re: Re: DBD::mysql with a forked processes caused lost MySQL connection unless mysql_auto_reconnect is set?

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: DBD::mysql with a forked processes caused lost MySQL connection unless mysql_auto_reconnect is set?
by perrin (Chancellor) on Jan 25, 2004 at 18:34 UTC
    The reason that moving the "use" doesn't work is that use is evaluated as if it were inside a BEGIN block. If you switch to "require", that will work, but you will have to call import as well. See "perldoc -f use" for more.