[Koha-bugs] [Bug 9967] Authorized values are not Plack-compatible

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Apr 4 00:49:22 CEST 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9967

--- Comment #11 from Robin Sheat <robin at catalyst.net.nz> ---
(In reply to Jacek Ablewicz from comment #10)
> 1/ In AddAuthorisedValue() there is a call to
> flush_cache('AddAuthorisedValue') instead of
> flush_cache('GetAuthorisedValue') - probably irrelevant.

Doh! But not the source of this issue.

> 2/ There are some Memoize and Memoize::Expire bugs reported in CPAN, perl
> monks etc. which are still unresolved since last available version (1.03)
> was published, e.g.: http://www.perlmonks.org/index.pl?node_id=1049426 .

Yeah, that's a bit fishy.

> 3/ I'm wondering if memoizing GetAuthorisedValue is such a good idea in the
> persistent environment.. Same thing for any subroutines which return
> references of any kind - unless we are 100% sure than the result data
> structures are always used in strictly read-only mode. Looks like it's not a
> case for GetAuthorisedValue(): it returns reference to array of hashrefs,

Well, it's something that gets called a lot so we need some optimisation.
Really what should happen is that you ask for all the authorised values in a
category, and then use the result of that for the rest of your scope. However I
don't plan on refactoring that right now :)

What I'll do instead is make some simple caching functions, including the
ability to a deep copy to avoid the need for a structure to never be modified.
This is something that'll come up more and more with plack. I'd still expect it
to be faster than a bazillion database requests, and it'll be safe enough with
persistence (and can be extended to use memcache in the future should that be
considered worthwhile.)

Thanks.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list