View | Details | Raw Unified | Return to bug 27245
Collapse All | Expand All

(-)a/misc/migration_tools/bulkmarcimport.pl (-6 / +7 lines)
Lines 252-264 else { Link Here
252
# the SQL query to search on isbn
252
# the SQL query to search on isbn
253
my $sth_isbn = $dbh->prepare("SELECT biblionumber,biblioitemnumber FROM biblioitems WHERE isbn=?");
253
my $sth_isbn = $dbh->prepare("SELECT biblionumber,biblioitemnumber FROM biblioitems WHERE isbn=?");
254
254
255
$dbh->{AutoCommit} = 0;
256
my $loghandle;
255
my $loghandle;
257
if ($logfile){
256
if ($logfile){
258
   $loghandle= IO::File->new($logfile, $writemode) ;
257
   $loghandle= IO::File->new($logfile, $writemode) ;
259
   print $loghandle "id;operation;status\n";
258
   print $loghandle "id;operation;status\n";
260
}
259
}
261
260
261
my $schema = Koha::Database->schema;
262
$schema->txn_begin;
262
RECORD: while (  ) {
263
RECORD: while (  ) {
263
    my $record;
264
    my $record;
264
    # get records
265
    # get records
Lines 537-550 RECORD: while ( ) { Link Here
537
            }
538
            }
538
            $yamlhash->{$originalid} = $biblionumber if ($yamlfile);
539
            $yamlhash->{$originalid} = $biblionumber if ($yamlfile);
539
        }
540
        }
540
        $dbh->commit() if (0 == $i % $commitnum);
541
        if ( 0 == $i % $commitnum ) {
542
            $schema->txn_commit;
543
            $schema->txn_begin;
544
        }
541
    }
545
    }
542
    print $record->as_formatted()."\n" if ($verbose//0)==2;
546
    print $record->as_formatted()."\n" if ($verbose//0)==2;
543
    last if $i == $number;
547
    last if $i == $number;
544
}
548
}
545
$dbh->commit();
549
$schema->txn_commit;
546
$dbh->{AutoCommit} = 1;
547
548
550
549
if ($fk_off) {
551
if ($fk_off) {
550
	$dbh->do("SET FOREIGN_KEY_CHECKS = 1");
552
	$dbh->do("SET FOREIGN_KEY_CHECKS = 1");
551
- 

Return to bug 27245