in reply to DB Connections resetting

Are you sure that your child processes are not re-using their parent's database connection?

Replies are listed 'Best First'.
Re^2: DB Connections resetting
by vmraj (Novice) on Nov 23, 2009 at 07:42 UTC
    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.

      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". ;-)