Opened 12 years ago
Closed 12 years ago
#1658 closed defect (fixed)
Batch importers fail to associate items with parent items
Reported by: | Jari Häkkinen | Owned by: | Nicklas Nordborg |
---|---|---|---|
Priority: | major | Milestone: | BASE 3.0.2 |
Component: | web | Version: | |
Keywords: | Cc: |
Description
The batch importer fails when I try to connect sample sources of subtype 'Case' to biosource items of subtype 'No'. I run the importer in 'update' only mode.
The stack trace:
net.sf.basedb.core.BaseException: failed to lazily initialize a collection of role: net.sf.basedb.core.data.ItemSubtypeData.relatedSubtypes, no session or session was closed on line 2 in file 'CASE_ConsentNotAsked.csv': 14067 1106272 Not... at net.sf.basedb.plugins.AbstractFlatFileImporter.doImport(AbstractFlatFileImporter.java:708) at net.sf.basedb.plugins.AbstractFlatFileImporter.run(AbstractFlatFileImporter.java:445) at net.sf.basedb.core.PluginExecutionRequest.invoke(PluginExecutionRequest.java:116) at net.sf.basedb.core.InternalJobQueue$JobRunner.run(InternalJobQueue.java:510) at java.lang.Thread.run(Thread.java:619) Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: net.sf.basedb.core.data.ItemSubtypeData.relatedSubtypes, no session or session was closed at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383) at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375) at org.hibernate.collection.AbstractPersistentCollection.readElementByIndex(AbstractPersistentCollection.java:176) at org.hibernate.collection.PersistentMap.get(PersistentMap.java:169) at net.sf.basedb.core.ItemSubtype.getRelatedSubtype(ItemSubtype.java:497) at net.sf.basedb.core.ItemSubtype.getRelatedSubtype(ItemSubtype.java:175) at net.sf.basedb.plugins.batchimport.SampleImporter.updateItem(SampleImporter.java:338) at net.sf.basedb.plugins.batchimport.SampleImporter.updateItem(SampleImporter.java:52) at net.sf.basedb.plugins.batchimport.AbstractItemImporter.handleData(AbstractItemImporter.java:754) at net.sf.basedb.plugins.AbstractFlatFileImporter.doImport(AbstractFlatFileImporter.java:676) ... 4 more
Change History (3)
comment:1 Changed 12 years ago by
Owner: | changed from everyone to Nicklas Nordborg |
---|---|
Status: | new → assigned |
comment:2 Changed 12 years ago by
Summary: | Batch importer fails to associate sample items to parent biosource items → Batch importers fail to associate items with parent items |
---|
The problems was simple to fix and affects all batch importers when all of the following are true:
- A single subtype has been selected for the 'Item subtypes' parameter
- A mapping has been provided for a column that links to other items that can also have a subtype (eg. a parent item, a protocol, etc.).
- No mapping has been specified for the 'Item subtype' column mapping.
comment:3 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note: See
TracTickets for help on using
tickets.
I think the error is caused by selecting exactly one subtype for the 'Item subtypes' parameter. Selecting 0 or >= 2 options should work as a temporary workaround. This will of course cause the function that assigns the selected subtype to new items to stop working, but this can also be done by mapping the 'Item subtype' column mapping to a constant value (the name of the desired subtype).