Bug 33987: Combine multiple db updates one in BatchCommitRecords
authorKyle M Hall <kyle@bywatersolutions.com>
Mon, 12 Jun 2023 18:20:53 +0000 (14:20 -0400)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 16 Jun 2023 13:55:20 +0000 (10:55 -0300)
commitab91409f7f3c18142e0694fab80effd7c0b35980
tree8be36048c0bede6592b6f60b0f7ce3aac59ec6cb
parent30d2ffd2953434eec112a403a0297e285fa4a76d
Bug 33987: Combine multiple db updates one in BatchCommitRecords

When replacing existing records BatchCommitRecords will the table import_records will be updated three times for three different fields by three different queries. Not only is this inefficient ( especially for large batches ), it seems that this is causing the dreaded "Lock wait timeout exceeded; try restarting transaction" error on some mysql/mariadb configurations.

1) Test plan
2) Download a marc record from Koha
3) Modify the title of that same bib in Koha
4) Stage the downloaded record and overlay the existing record
5) Verify the title has reverted to the original title from the
   downloaded record!

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
C4/ImportBatch.pm