[Dbix-class] multiple has_many rels in prefetch not supported in 0.081?

Matt S Trout dbix-class at trout.me.uk
Mon Aug 25 19:43:04 BST 2008


On Sat, Aug 23, 2008 at 08:53:27AM +0200, Moritz Onken wrote:
> Something like:
> 
> my $search = {  };
> my $attr = { prefetch => [ qw/tracks tags/ ] };
> 
> my $cd = $schema->resultset("Artist")->first->cds->search($search,  
> $attr)->first;
> $cd->tracks->all;
> $cd->tags->all;
> 
> did work for me. If you say it breaks in many cases I might have not
> tested it enough.
> Is there an alternative to get the same data with one query but still
> have all the relations working?

No, there isn't.

But the point we're trying to make is that all the cases -we- tried, it
was broken.

So what we need from you is to try and work out what cases you were hitting
that weren't broken, so we can make the exception only happen in cases
that are genuinely broken.

The exception was introduced to try and produce a sane error rather than
a random explosion further down. I'd be very happy to be able to -not-
throw an exception and have it work, but obviously we also still want to
throw an exception when we know it's not going to work.

Could you unpatch as Peter showed you and try some experiments, see if you
can figure out what works and what doesn't - or at least provide a bunch
of examples that do and don't and we'll try and figure out what the common
factor is?

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the DBIx-Class mailing list