Prevent ingest errors when asset.uri ID value outstrips asset.call_number
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 27 Oct 2010 02:26:18 +0000 (02:26 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 27 Oct 2010 02:26:18 +0000 (02:26 +0000)
commit7900914a81ef027c0d3d68de2fc17ccfe0373f86
treeebcd3b4a9e3932290f58debe7bcd002348f3d0bb
parent276ba86688f5187741371b60d76f684daf6517aa
Prevent ingest errors when asset.uri ID value outstrips asset.call_number

We were basing IDs in asset.uri on the max ID of asset.call_number,
which occasionally led to major ingest problems as attempts to insert
the next ID into asset.uri failed because that ID already existed. Using
the max ID from asset.uri for asset.uri inserts seems to make more sense
and does resolve that problem.

The bigger problem of not using the sequences that are already on these
tables to generate the IDs will not be an issue in 2.0, when we move to
in-database ingest and can use the normal lastval() approach to populate
asset.uri_call_number_map with the new values.

git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_6_0@18484 dcc99617-32d9-48b4-a31d-7c20da2025e4
Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm