Bug 18651: Do no LOCK/UNLOCK the table
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 21 Jun 2017 17:14:09 +0000 (14:14 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 21 Jun 2017 17:14:09 +0000 (14:14 -0300)
commit905572910b3af03d86fdbd3e52c72614f41c978b
tree44579afbb24c38ccac58ef9f02dad018f8d23a8d
parent2702b4688e31e62fb6851b7979dc56011d38ce89
Bug 18651: Do no LOCK/UNLOCK the table

We cannot LOCK the old_issues table here, other tables are accessed and DBIx::Class rename it with "me":
DBD::mysql::st execute failed: Table 'me' was not locked with LOCK
TABLES [for Statement "SELECT `me`.`issue_id`, `me`.`borrowernumber`,
`me`.`itemnumber`, `me`.`date_due`, `me`.`branchcode`,
`me`.`returndate`, `me`.`lastreneweddate`, `me`.`renewals`,
`me`.`auto_renew`, `me`.`auto_renew_error`, `me`.`timestamp`,
`me`.`issuedate`, `me`.`onsite_checkout`, `me`.`note`, `me`.`notedate`
FROM `old_issues` `me` WHERE ( `me`.`issue_id` = ? )" with ParamValues:
0='2'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1832.

Consequence: We could have a checkin refused if there is a race, but
this is the simplest and safest way to fix it.
C4/Circulation.pm