[Catalyst] Adjacency list "trees" and DBIC (recursion fun)

Dylan Vanderhoof DylanV at semaphore.com
Fri Dec 15 18:15:08 GMT 2006


> -----Original Message-----
> From: Jess Robinson [mailto:castaway at desert-island.demon.co.uk] 
> Sent: Friday, December 15, 2006 10:04 AM
> To: The elegant MVC web framework
> Subject: Re: [Catalyst] Adjacency list "trees" and DBIC 
> (recursion fun)
> 
> 
> What's happening here is that everytime you call ->foo->next, it's 
> creating your a NEW resultset, and next returns the first item in it, 
> always. DBIx::Class doesnt keep track of the resultsets it 
> creates for 
> you, you need to do that yourself (i.r. assign ->foo to a 
> variable, and 
> call next on that). This is basically to lessen the problem 
> of references 
> hanging around in DBIC and not getting garbage collected properly.
> 

I figured that might've been the problem, since it went away and is
functioning nicely if I explicitly create a new RS to traverse the tree
rather than making it anonymous like I was doing.

Thanks!

-D



More information about the Catalyst mailing list