Fetch-on-demand iterators (was Re: [CDBI] Make CDBI go fast)

Tim Bunce Tim.Bunce at pobox.com
Fri Feb 16 10:16:48 GMT 2007


On Fri, Feb 16, 2007 at 12:37:15AM -0500, Edward J. Sabol wrote:
> Ed Sabol wrote:
> >> This sounds cool, but the change makes me nervous. Some DBMSs and/or DBDs
> >> (Sybase, for example) don't like unfinished statement handles hanging around.
> >> Could be problematic in a mod_perl environment?
> 
> Michael Schwern replied:
> > Yes, this is a concern but its no worse a regular active statement handle.
> > It depends on how long your iterators live, you just now have to treat them
> > like you would statement handles. Further discussion and enhancements on
> > that can be found in the ticket notes on rt.cpan.org.
> >
> > One possibility is to move executing the statement handle into the iterator
> > so it doesn't even execute the query until you've asked for the first
> > object. This would make it safer to hand around iterator objects.
> >
> > I'm using this in a mod_perl environment with no problems yet.
> 
> Yeah, but you're not using Sybase with mod_perl, and I am, so hence my
> nervousness.

I think enabling mysql_use_result would raise the same issue for MySQL,
so it should be possible for Mr Schwern to check for problems while
developing.

Tim.



More information about the ClassDBI mailing list