[Koha-bugs] [Bug 29325] commit_file.pl error 'Already in a transaction'

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Oct 27 18:41:07 CEST 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29325

--- Comment #6 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
(In reply to Jonathan Druart from comment #5)
> +            # report progress and commit
> +            &$progress_callback($rec_num, $schema);
> +            $schema->txn_begin;
> 
> Should be the reverse. Commit then report progress (commit can fail).

The code is a bit tricky. The commit_file.pl-defined callback actually does the
commit. So we are basically calling the callback (because we reached the max
chunk size), which commits the chunk, and then start a new transaction for the
rest of the work.

This actually works for commit_file.pl.

And it is probably why I found manage-marc-import.pl not working: because it
originally didn't commit inside the callback.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list