From b0b773dbd49529d5395885856a97e6e07c3ea632 Mon Sep 17 00:00:00 2001 From: David Gustafsson Date: Fri, 4 Apr 2025 14:46:53 +0200 Subject: [PATCH] Bug 37020: bulkmarcimport gets killed after update to 24.05. when inserting large files Include checking for invalid marc data in main loop to avoid loading all marc data into memory at once. Signed-off-by: Jan Kissig Signed-off-by: Thomas Klausner --- misc/migration_tools/bulkmarcimport.pl | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl index ca4f8b2bd3..638753e589 100755 --- a/misc/migration_tools/bulkmarcimport.pl +++ b/misc/migration_tools/bulkmarcimport.pl @@ -325,8 +325,7 @@ my $logger = Koha::Logger->get; my $schema = Koha::Database->schema; my $lint = MARC::Lint->new; -$schema->txn_begin; -RECORD: while () { +while () { my $record; @@ -476,6 +475,7 @@ RECORD: while () { } } unless ($test_parameter) { + $schema->txn_begin; if ($authorities) { my $authtypecode = GuessAuthTypeCode( $record, $heading_fields ); @@ -726,15 +726,10 @@ RECORD: while () { @search_engine_records = (); } $schema->txn_commit; - $schema->txn_begin; } last if $record_number == $number || $records_exhausted; } -if ( !$test_parameter ) { - $schema->txn_commit; -} - if ($fk_off) { $dbh->do("SET FOREIGN_KEY_CHECKS = 1"); } -- 2.39.5