in reply to Problem with forking in perl

Hi,

I'm pretty sure that the problem comes from the fact that you share the DB-Connection. As soon as a child dies the connection is closed by the DESTROY function of the dbh-handle (DBI functionality). Have a look at DBIx::Connector.

UPDATE: Also have a look at perldoc DBI and search for InactiveDestroy.

Best regards
McA

Replies are listed 'Best First'.
Re^2: Problem with forking in perl
by rkrish (Acolyte) on Mar 14, 2013 at 07:33 UTC

    But here I'm not using a shared connection. I'm establishing a DB connection for every child process created. ( in sub ProcessRecords -LoginDB() ) and closing the connection in the same subroutine too.

      Sorry, I just saw the LoginDB() on line 24. What is this good for?

      McA