Hi!
I am running Windows’98 and ActiveState Perl 5.6.1! I am trying to use
forks and DBI and DBD::Mysql modules !
Using just forks is ok , using just DBI and DBD::Myslq modules is ok ,
when I try to use both ( forks and database modules ) I get a nice
Windows error “ This Program has performed an illegal operation and will
be shut down “ , “Perl caused an invalid page fault in module Perl56.dll
at … “ and a nice message at the command prompt like :
“panic: DBI active kids (-1) < 0 or > kids (0) at fork.pl line 7.
Database handle destroyed without explicit disconnect.
DBI handle cleared whilst still active.”
Could you please give a hint about what am I doing wrong?
I attached the script that gave the error and the Windows
crush message !
Thank you !
Bogdan Badiu
PS: I have installed ActivePerl and DBI and DBD::MySQL
under Linux and the script run ok !
PS2: Sorry for the retransmission, but an antivirus blocked
my script! I am including it in my mail!
use strict;
use DBI;
my $dbh =
DBI->connect("DBI:mysql:test;host=1.1.1.120;mysql_read_default_file=$ENV
{HOME}/.my.cnf");
my $pid;
$dbh->{'InactiveDestroy'}=1;
if (($pid=fork())==0)
{ print "Son \n";
$dbh->{'InactiveDestroy'}=1;
$dbh->disconnect();
exit();
}
else
{ $dbh->{'InactiveDestroy'}=0;
print "Parent ...\n";
$dbh->disconnect();
}