List:MySQL and Perl« Previous MessageNext Message »
From:Jochen Wiedmann Date:January 10 2003 10:07am
Subject:Re: Mem leak upon recovering after a disconnect
View as plain text  
Zitiere John Heitmann <JHeitmann@stripped>:

> for my $i (1..1000) {
> 	my $dbh = DBI->connect(...);
> 	$dbh->disconnect();
> 	$dbh->do(something);
> 	sleep(1);
> }

I do get you right, that the problem is caused because you
attempt to use a closed connection?


> It is easy to workaround once we found the problem, we just check the 
> Active flag before we do anything. Finding the problem took quite 
> awhile though :-(

By that you mean that you omit using the closed connection?


> I understand that the above construct is dubious.

It is not what I would have expected the users to do. :-)
Question: What happens, if you set the RaiseError flag and trap
the exception in the loop? (Using RaiseError is definitely
recommended.) Does that help?


Regards,

Jochen
Thread
Mem leak upon recovering after a disconnectJohn Heitmann10 Jan
  • Re: Mem leak upon recovering after a disconnectJochen Wiedmann10 Jan
    • Re: Mem leak upon recovering after a disconnectJohn Heitmann10 Jan