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)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 17 Jul 2023 12:13:05 +0000 (13:13 +0100)
commit818ee1c312a0685719ca3f136f61a94e88195efa
tree2b715f18a7e7cf3c8ddb09900e573dc04f660ebd
parent8893e876ec0771882f90fe62d6f73d78ecf162ec
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>
(cherry picked from commit ab91409f7f3c18142e0694fab80effd7c0b35980)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
C4/ImportBatch.pm