List:MySQL and Perl« Previous MessageNext Message »
From:Ulrich Borchers Date:September 15 2003 12:41pm
Subject:Re: DBD::mysql fork() problem
View as plain text  
I'm afraid I don't know about version specific differences of DBD::mysql
and if the driver can deal with fork() as you expect it to.
But I ran into this problem before. In fact mysql "went away" when
serveral child processes used the same handle AT THE SAME TIME.

fork() does not know about mysql. it makes a copy of a variable which in this
case is a reference to the same mysqld process (?). I think that each process
needs its own connection. Otherwise mysql could not handle concurrent
queries (over the same handle).

On 15 Sep 2003 at 14:20, H. Steuer wrote:

> Hi Uli,
> 
> thanks for your answer. in fact thats how fork() is supposed to be.
> if its a good idea or not to share handles depends on various things and exceeds the
> topic of this discussion. i just wonder why this module was working as expected and this
> behaviour was changed.
> 
> regards,
> h. steuer
> 
> 
> On Mon, 15 Sep 2003 14:15:32 +0200
> "Ulrich Borchers" <borchers@stripped> wrote:
> 
> > imho to share a single connection between serveral processes is not a good idea
> > anyway.
> > after fork() you can disconnect and reconnect, thus creating a new
> > database handle for the child process.
> > 
> > 
> 


MfG
Ulrich Borchers

-- 
Dipl.-Inf. Ulrich Borchers
MEGABIT Informationstechnik GmbH
Karstr. 25, 41068 Mönchengladbach
Tel. +49 2161 30898-28


Thread
DBD::mysql fork() problemH. Steuer15 Sep
  • Re: DBD::mysql fork() problemUlrich Borchers15 Sep
    • Re: DBD::mysql fork() problemH. Steuer15 Sep
      • Re: DBD::mysql fork() problemJochen Wiedmann15 Sep
      • Re: DBD::mysql fork() problemUlrich Borchers15 Sep
  • Re: DBD::mysql fork() problemRudy Lippan15 Sep