]> git.koha-community.org Git - koha.git/commit
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)
committerFridolin Somers <fridolin.somers@biblibre.com>
Mon, 11 Jan 2021 11:05:20 +0000 (12:05 +0100)
commitf0dadd169b08f3b486ea387cdbb7f93c13b8d3db
tree03ab3a9ef5488db57a72a8193181091c2ce69a11
parent48235e4d616a8bc9a330733486799270409331a3
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>
(cherry picked from commit 4a90c0b647fdfdb0a39b43f6b10adba3bca53215)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
misc/migration_tools/bulkmarcimport.pl