LP#1596595 Targeter use child editor for settings
authorBill Erickson <berickxx@gmail.com>
Tue, 7 Feb 2017 15:27:52 +0000 (10:27 -0500)
committerBill Erickson <berickxx@gmail.com>
Tue, 14 Feb 2017 16:22:03 +0000 (11:22 -0500)
commit9f97a21e1edae56ebc33458f8e09bf89f508a83c
tree92cd05d061f2cdf4871464c9299f2ec60656223c
parent15344f24e3c4574ef2a235ba258ea541f97e7967
LP#1596595 Targeter use child editor for settings

Use the CStoreEditor linked to the ::Single (child) targeter object when
possible to fetch org unit setting values.

In cases where settings for many org units have to be retrieved at once,
the settings lookups can take long enough that the in-transaction editor
on the child targeter can timeout.  Using the child's editor directly
for the lookups will prevent this timeout and make the lookups a little
bit faster, since a new connect will not be required for each lookup.

This timeout scenario can occur with settings like
circ.holds.max_org_unit_target_loops and
circ.holds.target_when_closed, when there is wide variety of targetable
copies, because each have to be fetched once per target-able copy circ lib.

A secondary optimization would be a batch org setting lookup that
batches on org unit instead of setting name.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm