]> git.evergreen-ils.org Git - Evergreen.git/commit
LP#1664386: fix certain subrequests that control DB transactions
authorGalen Charlton <gmc@equinoxinitiative.org>
Mon, 13 Feb 2017 22:18:28 +0000 (17:18 -0500)
committerBill Erickson <berickxx@gmail.com>
Mon, 13 Feb 2017 22:47:04 +0000 (17:47 -0500)
commit90c5c52e2f97a2f6a9a48ac8efb1330c26b73668
treec02fae47fcfca17b7674ebf88a74dbe280731cdb
parentf7215da5476e8fd73f5a2136ecde39e721c1000f
LP#1664386: fix certain subrequests that control DB transactions

This patch removes all cases where the current OpenSRF client
object is passed to

$self->method_lookup('open-ils.storage.transaction.{begin/rollback}')->run()

This idiom is no longer needed, as session information required to
generate a transaction ID is reliably passed to subrequests. Without
this patch, current Evergreen master and OpenSRF master will cause
the following methods to return not only their results, but also
"1" from each use of this idiom:

open-ils.storage.actor.user.checked_out
open-ils.storage.booking.reservation.resource_targeter
open-ils.storage.action.hold_request.copy_targeter

To test
-------
[1] Be running current Evergreen master and OpenSRF master
    (or the 2.5 alpha)
[2] Run (say) open-ils.storage.actor.user.checked_out in srfsh:

srfsh# request open-ils.storage open-ils.storage.actor.user.checked_out 13

Received Data: 1

Received Data: 1

Received Data: {
  "out":[

  ],
  "claims_returned":[

  ],
  "long_overdue":[

  ],
  "overdue":[
    "55",
    "56",
    "57",
    "58",
    "59",
    "60"
  ],
  "lost":[

  ]
}

[3] Note the extraneous 'Received Data: 1' sent prior to the substantive
    response.
[4] Apply the patch and rerun step 2; note that this time
    only the desired response is sent.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/actor.pm