Opened 7 years ago

Closed 7 years ago

#1930 closed defect (fixed)

Can't run batch importers in 'create' mode when using multiple lines per item

Reported by: Nicklas Nordborg Owned by: everyone
Priority: major Milestone: BASE 3.4.2
Component: coreplugins Version:
Keywords: Cc:

Description

That batch importers have support for using multiple lines to import data to a single item. This is for example needed when connecting a child pooled biomaterial with all of it's parent biomaterials, or when adding multiple data files to a raw bioassay.

But this feature doesn't work in 'create' mode. The batch importer will choke as soon as it finds the second line of data for a new item. The stacktrace below is from the test code that has been modified to run the importer in 'create' mode instead of 'create+update' mode.

net.sf.basedb.core.BaseException: Item already exists:
Sample[Name=Pooled sample] on line 6 in file 'data_test.batchimport.samples.txt2578': Pooled sample
        at TestJob.test_execute(TestJob.java:113)
        at TestItemImporter.test_all(TestItemImporter.java:125)
        at TestItemImporter.main(TestItemImporter.java:58)
Caused by: net.sf.basedb.core.BaseException: Item already exists: 
Sample[Name=Pooled sample] on line 6 in file 'data_test.batchimport.samples.txt2578': Pooled sample
        at net.sf.basedb.plugins.AbstractFlatFileImporter.doImport(AbstractFlatFileImporter.java:716)
        at net.sf.basedb.plugins.AbstractFlatFileImporter.run(AbstractFlatFileImporter.java:450)
        at net.sf.basedb.core.PluginExecutionRequest.invoke(PluginExecutionRequest.java:116)
        at TestJob.test_execute(TestJob.java:97)
        ... 2 more
Caused by: net.sf.basedb.core.ItemAlreadyExistsException: Item already exists: Sample[Name=Pooled sample]
        at net.sf.basedb.plugins.batchimport.AbstractItemImporter.handleData(AbstractItemImporter.java:755)
        at net.sf.basedb.plugins.AbstractFlatFileImporter.doImport(AbstractFlatFileImporter.java:684)
        ... 5 more

Change History (2)

comment:1 Changed 7 years ago by Nicklas Nordborg

(In [6778]) References #1930: Can't run batch importers in 'create' mode when using multiple lines per item

Updated batch importer test code to use 'create' mode when importing raw bioassays. This current fails Item already exists: Raw bioassay[Name=Raw data 2] on line 4 in file...

comment:2 Changed 7 years ago by Nicklas Nordborg

Resolution: fixed
Status: newclosed

(In [6779]) Fixes #1930: Can't run batch importers in 'create' mode when using multiple lines per item

If the found item is a new item not yet stored in the database the updateMultiLineItem is allowed.

Note: See TracTickets for help on using tickets.