On Tue, Aug 15, 2000 at 12:22:46PM -0500, Jay Jacobs wrote:
>
>
> On Tue, 15 Aug 2000, Tom Mornini wrote:
>
> > It is my understanding of the DBI docs that you only need to call
> > $sth->finish when you DON'T fetch all the rows that the $sth has ready to
> > return.
> >
>
> >From "Writing Apache Modules with Perl and C":
> "You should still call finish() at the end of each series of fetches,
> even though you are going to reuse the statement handler. Failure to do
> so can lead to memory leaks."
Not true. Unless there's a driver bug, in which case anything can happen.
> If I remember correctly, it also frees up any resources used by the
> database (depending on db) for the query, like for sorting, joining,
> etc. But I can't quote a source for that one.
Me. But it's only relevant if you're _not_ fetching _all_ rows.
> >From my point of view, it never hurts to call finish()...
True.
Tim.