Bug 18343 - Manage MARC import DBH should not be shared
Summary: Manage MARC import DBH should not be shared
Status: RESOLVED DUPLICATE of bug 18806
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
Depends on: 8970
Blocks:
  Show dependency treegraph
 
Reported: 2017-03-28 07:32 UTC by Fridolin Somers
Modified: 2017-06-27 15:00 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 18343 - Manage MARC import DBH should not be shared (2.78 KB, patch)
2017-03-28 13:18 UTC, Fridolin Somers
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2017-03-28 07:32:31 UTC
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.
Comment 1 Fridolin Somers 2017-03-28 13:18:28 UTC
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.
Comment 2 Fridolin Somers 2017-03-28 13:31:38 UTC
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.
Comment 3 Jonathan Druart 2017-03-28 14:46:36 UTC
Why do not you implement transaction using DBIx::Class directly?
That will be easier and backportable as well.
Comment 4 Fridolin Somers 2017-05-12 13:29:44 UTC
(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 ?
Comment 5 Jonathan Druart 2017-05-12 14:21:48 UTC
The quick fix is to use DBIx::Class transactions.
Comment 6 Fridolin Somers 2017-06-27 15:00:10 UTC

*** This bug has been marked as a duplicate of bug 18806 ***