LP#1653742 Copy tree authoritative API share cstores user/berick/lp1653742-copy-tree-authoritative-eats-cstores
authorBill Erickson <berickxx@gmail.com>
Tue, 3 Jan 2017 16:59:26 +0000 (11:59 -0500)
committerBill Erickson <berickxx@gmail.com>
Tue, 3 Jan 2017 16:59:31 +0000 (11:59 -0500)
commit3b3fb95ed7947d967c7ccdd5335d7659792bb18c
tree2eb4030986a7cdb5161bbed0fc0df993a19df148
parentf67b07b4e57dad132bd50f25d5abaa8f74bb0cdd
LP#1653742 Copy tree authoritative API share cstores

Avoid opening one cstore connection per requested org unit in the
open-ils.cat.asset.copy_tree.retrieve.authoritative API by creating a
single shared cstore connection at the top of the API shared by all
API actions.

To test:

1. In one terminal:

% tail osrfsys.log | grep transaction.begin

2. In another terminal:

srfsh% request open-ils.cat
open-ils.cat.asset.copy_tree.retrieve.authoritative "AUTOTOKEN", 217,
[1,2,3,4,5,6,7,8,9]

3. 9 cstore transactions are opened before patching.  After patching,
only 1 is created.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm