Bug 27245: Replace AutoCommit=0 with txn_begin in bulkmarcimport.pl
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 18 Dec 2020 13:41:12 +0000 (14:41 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 8 Jan 2021 14:17:22 +0000 (15:17 +0100)
commit4a90c0b647fdfdb0a39b43f6b10adba3bca53215
treed37919c6430ee41a17e3ec96916cdb0e3704d42f
parentd2e2a3975fb66d8c2e2766ecbe014fb71952e6d0
Bug 27245: Replace AutoCommit=0 with txn_begin in bulkmarcimport.pl

To prevent
DBD::mysql::db begin_work failed: Already in a transaction at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1588, <GEN45> line 1.

Test plan:
1 - Export more than 100 records
2 - Use bulkmarcimport (with -commit=10) to import them
    perl misc/migration_tools/bulkmarcimport.pl -b -file testbmi.xml -v -m=MARCXML --commit=10
3 - Modify a record to make the import fail (for instance having a too long
lccn)
4 - Use bulkmarcimport (with -commit=10) to import them
    perl misc/migration_tools/bulkmarcimport.pl -b -file testbmi.xml -v -m=MARCXML --commit=10
5 - Notice that the import stops but that the imported record are imported (apart from the last batch of 10)

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
misc/migration_tools/bulkmarcimport.pl