Well, this is only a guess, but I would expect that the ActiveState Perl 5.6.1
for Windows fork() implementation does not support the kind of things that DBI
and DBD::mysql do, storing pointers to C structures in Perl objects.  So unless
somebody patches DBI and DBD::mysql to support interpreter threads, this will
never work.  Your best bet may be to use Cygwin's perl instead (www.cygwin.com).

-John





"Bogdan Badiu" <[EMAIL PROTECTED]> on 04/08/2002 03:55:47 AM

To:   [EMAIL PROTECTED]
cc:    (bcc: John Tobey/Intdata)

Subject:  Windows, forks and databases ...




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();
            }




Reply via email to