Hello Reinhard,

Thanks for confirming my concerns. So you say that on 5.6.x it is ok, but not on 5.8.x. But threading + mysql is quite a powerful combination to give up!

I wonder if anybody in this mailing list has a workaround/ solution.

Reinhard Pagitsch wrote:

Hello,

I tryed it also with Perl v5.8.7 and had the same prroblem as you, on the 2nd doIt Perl crashes.
I also found out that Perl crashes in the DBI.pm sub "disconnect_all".
Removing "use threads;"  it works.

regards,
Reinhard

Foo Ji-Haw wrote:

Hello Reinhard,

I am using 5.8.6 of ActivePerl. Thanks for checking out the codes.

Reinhard Pagitsch wrote:

Hello,


Foo Ji-Haw wrote:

Hi all,

I thought I can hit a nice milestone today, but it seems that I have hit a strange obstacle instead. In my tests, the following code will run, but when it terminates an error message will be shown.
use strict;
use warnings;
use DBI;
use threads;

doIt();
doIt();

sub doIt
{
  my $dbh = DBI->connect('dbi:mysql:database','username','password');
  my $stmt = $dbh->prepare ('select id from tablename');
  $stmt->execute();
  while (my $record=$stmt->fetchrow_hashref('NAME_lc')) {}
}

Change the database connection parameters (eg. username, password, table name) to your database.

My analysis of the problem is as follows:
1. Using the ODBC driver is ok. I've tested with MSSQL connection and it's fine. 2. The problem lies with using threads alongside DBI. If I take out 'use threads' all is well. 3. There are 2x doIt() calls because it only fails on the second database connection. 4. It seems to be related to fetchrow_hashref(), because if I take that out, all is fine.

Can someone confirm this? Is there anybody who can suggest a workaround? Thanks.

There is no problem here, Perl v5.6.1. Which Perl version do you use?

regards,
Reinhard




_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to