[by now you're probalby sick of the cartoon version of my schema, but
 here it is...]

I'm using DBIx-Class-0.06003, and have cache => 1 in my ->search.

I have an 

  rn
    has_many nodes

  nodes
    has_many attrs

and I have a bunch of code that looks vaguely like this:

  ($n1, $n2) = $rn->nodes;

  ($apes_1) = grep {$_->name eq 'APE'} $n1->attrs();
  ($meece_1) = grep {$_->name eq 'MOOSE'} $n1->attrs();
  ($mice_1) = grep {$_->name eq 'MOUSE'} $n1->attrs();

  ($apes_2) = grep {$_->name eq 'APE'} $n2->attrs();
  ($meece_2) = grep {$_->name eq 'MOOSE'} $n2->attrs();
  ($mice_2) = grep {$_->name eq 'MOUSE'} $n2->attrs();

And, watching the output generated by setting
DBIX_CLASS_STORAGE_DBI_DEBUG I see it constantly going back to the
database for the same set of attrs.

Shouldn't the cacheing be avoiding this?

Is the cachedness somehow associated with $rn, but not the nodes that
I get from ->nodes()?

Thanks,

g.

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to