Bug 8970 reported an issue with stage-marc-import.pl sharing the DB handler in Plack context. There is the same issue with tools/manage-marc-import.pl. To create a transaction, one must create a new DB handler.
Created attachment 61659 [details] [review] Bug 18343 - Manage MARC import DBH should not be shared Bug 8970 reported an issue with stage-marc-import.pl sharing the DB handler in Plack context. There is the same issue with tools/manage-marc-import.pl. To create a transaction, one must create a new DB handler. Test plan : - In Staff interface Tools - Go to "Stage MARC records for import" - Import a marc records file with several records - Click on "Manage staged records" - Click on "Import this batch into the catalog" - Click on "Undo import into catalog" Test with and without Plack. To test with Plack you may apply Bug 17240.
I've created this patch in order to do like Bug 8970, mainly for stable branches. Maybe another must change to use DBIx transactions like in Bug 18329.
Why do not you implement transaction using DBIx::Class directly? That will be easier and backportable as well.
(In reply to Jonathan Druart from comment #3) > Why do not you implement transaction using DBIx::Class directly? > That will be easier and backportable as well. It was to have a quick fix. Is it backportable to 3.22 ?
The quick fix is to use DBIx::Class transactions.
*** This bug has been marked as a duplicate of bug 18806 ***