in reply to Re: DB Connections resetting
in thread DB Connections resetting

I printed dbh and it gives different mysql_thread_id. Doesn't it mean that they are different connections? If I am wrong how do i find out whether they are the same connection or not.

Replies are listed 'Best First'.
Re^3: DB Connections resetting
by afoken (Chancellor) on Nov 23, 2009 at 16:35 UTC

    Look at your code. When you create a DBI connection and fork() after that, your child processes will try to use the DBI connection from the parent, and usually fail miserably. Create the connection after fork()ing, not before. If you need a connection before you fork(), close it before calling fork().

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)