Hello, When I run misc/batchRebuildItemsTables.pl , I get the following errors : DBD::mysql::db begin_work failed: Already in a transaction at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1590. DBD::mysql::db begin_work failed: Already in a transaction at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1590. Seems an issue similar to bug #27245. Many thanks, Best, Julien Sicot Systems Librarian Rennes 2 university
Created attachment 122385 [details] [review] Bug 28399: Remove txn error from batchRebuildItemsTables.pl
Hi Julien, I am not familiar with the script so hard to fully test it, but this patch should remove the error you got. Can you confirm?
Hi Jonathan, Patch applied in master I confirm it removes errors. Many thanks, Julien
Last one: $schema->txn_commit unless $test_parameter; Would it be more appropriate/neat to rollback when testing here?
(In reply to Marcel de Rooy from comment #4) > Last one: > $schema->txn_commit unless $test_parameter; > > Would it be more appropriate/neat to rollback when testing here? It will rollback without commit, the result is the same. I just kept the same line as before. Happy to adjust if you think it is more readable with rollback (note that we are using "unless $test" above).
(In reply to Jonathan Druart from comment #5) > (In reply to Marcel de Rooy from comment #4) > > Last one: > > $schema->txn_commit unless $test_parameter; > > > > Would it be more appropriate/neat to rollback when testing here? > > It will rollback without commit, the result is the same. Yes, it is quite theory. The rollback will be executed a fraction later at the disconnect (which we probably skip too ;) No blocker for me.
Created attachment 122611 [details] [review] Bug 28399: Remove txn error from batchRebuildItemsTables.pl Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Pushed to master for 21.11, thanks to everybody involved!
Pushed to 21.05.x for 21.05.02
Pushed to 20.11.x for 20.11.09
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.