Am 22.08.2008 um 23:42 schrieb Peter Rabbitson:

Moritz Onken wrote:
Hi,

I installed the latest svn revision of DBIx-Class-0.08099_04 and my code fails serval times because I prefetch multiple has_many rels. This was
no problem with 0.08010. Why did you change this behaviour? I didn't
read anything about this on thsi list.
I have to change a lot of code for 0.081 and it makes it even slower
because my application needs to hit the database even more.

Hope someone can explain why this happened.

As mst said it never worked in the first place. I was the one who wrote
the failing tests for this. To see for yourself:

svn co http://dev.catalyst.perl.org/repos/bast/DBIx-Class/0.08/trunk
dbic -r 4433
cd dbic
perl Makefile.PL
make
prove -v -Ilib t/77prefetch.t

Enjoy the fireworks :)

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?

moritz

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]

Reply via email to