4 messages in com.mysql.lists.perlProblem with disconnect
FromSent OnAttachments
Jan Eden29 Apr 2004 03:18 
David Dick29 Apr 2004 04:26 
Rudy Lippan29 Apr 2004 05:58 
Jan Eden01 May 2004 13:48 
Subject:Problem with disconnect
From:Jan Eden (lis@janeden.org)
Date:04/29/2004 03:18:56 AM
List:com.mysql.lists.perl

Hi,

I receive the following error using $dbh->disconnect:

DBI::db=HASH(0x812938)->disconnect invalidates 1 active statement handle (either
destroy statement handles or call finish on them before disconnecting) at
./pdfshorten.pl line 37.

I do not understand this. It's an extremely simple test script like this. The
relevant part is this:

--- my $dbh = DBI->connect("dbi:mysql:$db:$server", $username, $password, {
RaiseError => 1 });

my $query = "SELECT page_id, content FROM pages WHERE page_id = 1583"; my $sth = $dbh->prepare($query); $sth->execute(); my ($id, $content) = $sth->fetchrow_array; # modify $content here my $query2 = "UPDATE pages SET content = $content WHERE page_id = $id"; my $sth2 = $dbh->prepare($query2); $sth2->execute();

$dbh->disconnect;

---

In other scripts (used in conjuction with CGI), I never got a warning like this.

Grateful for explanations,

Jan