in reply to Re: DBI ERROR
in thread DBI ERROR

my ($self, @cursors) = @_; my $cursor; foreach $cursor (@cursors) { if (exists($self->{CURSORS}{$cursor})) { # eval { my $ref = $self->{CURSORS}{$cursor}; delete($self->{CURSORS}{$cursor}); $ref->finish; } } } } if ($self->{CONNECTION} && !$self->{CONNECTION}->{InactiveDestro +y}) { $self->{CONNECTION}->disconnect;
I am checking if there is any open cursor. Hope it helps. DBI Version is 1.06 and perl version is 5.0.3

Replies are listed 'Best First'.
Re: Re: Re: DBI ERROR
by chromatic (Archbishop) on Apr 14, 2001 at 08:50 UTC
    Tim Bunce sent me an e-mail earlier this week where he pointed out that it's very rare that you need to call finish() explicitly. If you're querying a large result set and only fetch a couple of rows, you could call it to free up memory.

    I don't have the DBI book with me, or I'd quote chapter and verse, but I know there's something about it in the DBI manpage. You can probably get by without it here, unless you're doing something exotic. (You might also like prepare_cached()).