error using threads in DB2
- From: "prashanth" <prashanth.meka@xxxxxxxxx>
- Date: 27 Sep 2006 11:10:21 -0700
I am trying to use threads with the DBD::DB2 driver and get an error
saying that DBD::DB2 has no driver CLONE(). Can someone please tell me
why I am getting this error?
The program I am using is:
#!perl
use Thread;
use Clone;
use Clone qw(clone);
use DBI;
use DBD::DB2;
use DBD::DB2::Constants;
my $db = 'sample';
my $user = 'user';
my $pass = 'password';
my $dbh = DBI->connect("dbi:DB2:$db", $user, $pass) || die "Unable to
connect. error: $DBI::errstr\n";
my $stmt = "SELECT * FROM TEST";
my $sth = $dbh->prepare($stmt);
$sth->execute();
while(my @row=$sth->fetchrow){
print "$row[0] $row[1]\n";
my $conn1 = new Thread \&fetch_sub;
sleep(5);
}
sub fetch_sub{
}
The error is:
DB2 has no driver CLONE() function so is unsafe threaded
This is on a Linux environment with DB2v9.1.
.
- Prev by Date: Re: Oracle Troubleshooter HOWTO on my homepage
- Next by Date: DBD 1.18a make not working
- Previous by thread: Oracle Troubleshooter HOWTO on my homepage
- Next by thread: DBD 1.18a make not working
- Index(es):
Relevant Pages
|
|