Summary: | bulkmarcimport.pl error 'Already in a transaction' | ||
---|---|---|---|
Product: | Koha | Reporter: | Fridolin Somers <fridolin.somers> |
Component: | Command-line Utilities | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | major | ||
Priority: | P5 - low | CC: | andrew, caroline.cyr-la-rose, jonathan.druart, kyle, robin, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29325 | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Small patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: |
21.05.00,20.11.02,20.05.08,19.11.14
|
Circulation function: | |
Bug Depends on: | 26518 | ||
Bug Blocks: | |||
Attachments: |
Bug 27245: Replace AutoCommit=0 with txn_begin in bulkmarcimport.pl
Bug 27245: Replace AutoCommit=0 with txn_begin in bulkmarcimport.pl Bug 27245: Replace AutoCommit=0 with txn_begin in bulkmarcimport.pl |
Description
Fridolin Somers
2020-12-16 09:17:24 UTC
Created attachment 114521 [details] [review] 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: Export more than 100 records Use bulkmarcimport (with -commit=10) to import them Modify a record to make the import fail (for instance having a too long lccn) Use bulkmarcimport (with -commit=10) to import them Notice that the import stops but that the imported record are imported (a part from the last batch of 10) Without the patch I'm getting «Already in a transaction» even with a (supposedly) valid MARCXML file with 120 records. I just exported the first 120 records of the sample data in XML. With the patch, with valid or invalid data, it's just importing one record: kohadev-koha@kohadevbox:/kohadevbox/koha$ misc/migration_tools/bulkmarcimport.pl -commit 10 -file 120-records.xml . 1 MARC records done in 0.0640840530395508 seconds kohadev-koha@kohadevbox:/kohadevbox/koha$ misc/migration_tools/bulkmarcimport.pl -commit 10 -file 120-records-one-invalid.xml . 1 MARC records done in 0.0556449890136719 seconds Maybe I'm missing a param from bulkmarcimport.pl? (-b doesn't help) For me its ok, works as expected Created attachment 114750 [details] [review] 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: Export more than 100 records Use bulkmarcimport (with -commit=10) to import them Modify a record to make the import fail (for instance having a too long lccn) Use bulkmarcimport (with -commit=10) to import them Notice that the import stops but that the imported record are imported (a part from the last batch of 10) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> @Fridolin how did you use bulkmarcimport.pl ? And how did you get the records? So I can test with then to check if my records were wrong. Created attachment 114958 [details] [review] 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> Pushed to master for 21.05, thanks to everybody involved! Pushed to 20.11.x for 20.11.02 Pushed to 20.05.x for 20.05.08 Backported: Pushed to 19.11.x branch for 19.11.14 |