Bug 8970 - fix MARC import under plack
authorRobin Sheat <robin@catalyst.net.nz>
Tue, 29 Apr 2014 06:17:59 +0000 (18:17 +1200)
committerGalen Charlton <gmc@esilibrary.com>
Sun, 25 May 2014 23:51:12 +0000 (23:51 +0000)
commit750a9ec97cbc44c6d1d8a6c595019cee7d96ef8e
treeace498c1ca97170d1ce549a8eb24d9abd34dbca8
parent695c7f7bef59040ed236bc9f25056b4924fb6528
Bug 8970 - fix MARC import under plack

There were database handles being shared between a parent and a child
process, which is a big no-no, and was leading to crazy crashes. Fine
under CGI, but not in a persistent environment. This causes the child to
make a new database handle to use. Also some small cleanups.

To test:
* In a plack environment,
* Tools -> stage MARC records for import
* Use a reasonable size file (but not too big as it all goes into RAM -
  I made one about 40MB.)
* Make sure that it works, and that the progress bars progress.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Tested with a 55M file, I reproduced the error and I confirm this patch
fixes it.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
tools/stage-marc-import.pl