https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33972
--- Comment #4 from Marcel de Rooy <[email protected]> --- (In reply to Nick Clemens from comment #0) > In BatchCommitRecords we currently > > Start a transaction > ... > SetImportBatchStatus($batch_id, 'importing'); > ... > SetImportBatchStatus($batch_id, 'finished'); > ... > Finish the transaction > > > In certain settings the second call fails as it is waiting for the first to > commit it seems: > [Fri Jun 9 09:06:29 2023] background_jobs_worker.pl: > C4::ImportBatch::SetImportBatchStatus(): DBI Exception: DBD::mysql::db do > failed: Lock wait timeout exceeded; try restarting transaction at > /usr/share/koha/lib/C4/ImportBatch.pm line 717 > > Setting the status twice inside the transaction doesn't make sense - the DB > will never show the 'importing' status - as it will either be rolled back > when the transaction fails, or set to 'finished' when it completes Normally, you should be able to update the same record within the same transaction. And only another transaction trying to get/update this same record in import_batches should be locked. So, are you sure that there was no second process involved? The other thing, though, is that SetImportBatchStatus asks for another db handle via Context/Koha::Database. Since you have a connection, you would not expect a problem. But is it possible that somehting there somehow goes wrong? Would it be an idea to move the second SetImportBatchStatus call at the end also after the transaction? Hard to verify if we dont know the exact cause and cannot reproduce.. -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
