-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Jonathan,

Can you explain why you think that? When I run my code, I see the $dbh hash change inside of the child process and the parent hash stay the same. Aren't I avoiding using the same handle by doing a $dbh = undef in the child and then calling connect again?

Thanks,
Aaron

- --
Aaron Turner, Sr. Security Engineer <[EMAIL PROTECTED]>
Ph: 408.329.6320          Fax: 408.329.6317


On Nov 5, 2005, at 9:56 PM, Jonathan Leffler wrote:

On 11/5/05, Aaron Turner <[EMAIL PROTECTED]> wrote:

So I'm trying to track down a problem with my program which forks
needing both parent and children to have access to the database via
Class::DBI. The basic issue I'm having is that after the first child
exits, the parent's DBI connection seems to get mangled, because it
can no longer find the prepared statements created by Class::DBI.
[...]


So, the DBI manual says words to the effect of "don't try reusing handles in
child processes - it usually won't work", and your code seems to be
demonstrating exactly that.

Each process that needs to connect to a database needs to connect
separately.

--
Jonathan Leffler <[EMAIL PROTECTED]> #include <disclaimer.h>
Guardian of DBD::Informix - v2005.02 - http://dbi.perl.org
"I don't suffer from insanity - I enjoy every minute of it."

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)

iD8DBQFDbb9MklVhPAXg8nARAsEUAJ4wSgy7SazBf1u27yUaEw45vqSorACfUFPW
ZQv8zFbOs7drORma17NBTDU=
=ty53
-----END PGP SIGNATURE-----

Reply via email to