https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36350 --- Comment #34 from David Gustafsson <glasklas@gmail.com> --- (In reply to David Cook from comment #23)
Comment on attachment 177371 [details] [review] Bug 36350: Add caching for Objects::find and Objects::search
Review of attachment 177371 [details] [review]: -----------------------------------------------------------------
::: Koha/Objects/Cached.pm @@ +67,5 @@
+ else { + my @args; + push(@args , $cond) if defined $cond; + # Don't include if only contains "cache" key + push(@args, $attrs) unless keys %{$attrs} == 1 && defined $attrs->{cache};
As I note above, "cache" is actually an attribute that DBIx::Class actually uses for caching search results in a ResultSet, so I don't think we should meddle with it.
I'm still not sold on this change overall, but you might want to think of a key like "koha_cache" to clearly differentiate it from DBIx::Class's "cache".
I am aware of this, and though the cache option in DBix is very poorly documented I think it's actually necessary to enable it in DBix as well, at lease for search, as ->next otherwise will perform the query again. With the cache option set we are able to cache the resultset and being able to call next, reset etc without any further trips to the database. -- You are receiving this mail because: You are watching all bug changes.