The script disables AutoCommit and calls commit on the dbh directly. As this dbh is shared I believe it closes all current transactions. We have seen in the logs a warning when the cron is running during library operating hours: DBIx::Class::Storage::DBI::mysql::_exec_svp_release(): DBI Exception: DBD::mysql::db do failed: SAVEPOINT savepoint_3 does not exist at /usr/share/koha/lib/Koha/Object.pm line 170 I believe if we resolve bug 36474, effectively reducing the scope fo the job from "all records in the DB" to "only updated records" - we can remove the need for delayed commits here.
Created attachment 170908 [details] [review] Bug 37775: Remove delayed commits from update_totalissues.pl and add progress option This patch removes setting AutoCommit to 0 and commiting only every X records. Instead we commit as we go and report progress using a parameter. Bug 36474 reduced the numebr of changes that are being committed, so this should be a reasonable change. The use of commits without transactions was causing problems if the library was active while the script ran. To test: 1 - perl misc/cronjobs/update_totalissues.pl -c 2 - Script runs, but with unknown parameter 3 - perl misc/cronjobs/update_totalissues.pl -p 10 4 - Script runs and reports every 10 records 5 - per; misc/cronjobs/update_totalissues.pl 6 - Script runs and reports every 100 records by default
Created attachment 170909 [details] [review] Bug 37775: Spelling and tidy
Created attachment 171490 [details] [review] Bug 37775: Remove delayed commits from update_totalissues.pl and add progress option This patch removes setting AutoCommit to 0 and commiting only every X records. Instead we commit as we go and report progress using a parameter. Bug 36474 reduced the numebr of changes that are being committed, so this should be a reasonable change. The use of commits without transactions was causing problems if the library was active while the script ran. To test: 1 - perl misc/cronjobs/update_totalissues.pl -c 2 - Script runs, but with unknown parameter 3 - perl misc/cronjobs/update_totalissues.pl -p 10 4 - Script runs and reports every 10 records 5 - per; misc/cronjobs/update_totalissues.pl 6 - Script runs and reports every 100 records by default Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Created attachment 171491 [details] [review] Bug 37775: Spelling and tidy Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Created attachment 171648 [details] [review] Bug 37775: Remove delayed commits from update_totalissues.pl and add progress option This patch removes setting AutoCommit to 0 and commiting only every X records. Instead we commit as we go and report progress using a parameter. Bug 36474 reduced the numebr of changes that are being committed, so this should be a reasonable change. The use of commits without transactions was causing problems if the library was active while the script ran. To test: 1 - perl misc/cronjobs/update_totalissues.pl -c 2 - Script runs, but with unknown parameter 3 - perl misc/cronjobs/update_totalissues.pl -p 10 4 - Script runs and reports every 10 records 5 - per; misc/cronjobs/update_totalissues.pl 6 - Script runs and reports every 100 records by default Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 171649 [details] [review] Bug 37775: Spelling and tidy Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Thanks for all the hard work! Pushed to main for the next 24.11.00 release as RM Assistant
Backported to 24.05.x for upcoming 24.05.04
Pushed to 23.11.x for 23.11.10
Not backporting to 23.05.x unless requested