Simultaneous update of a file's parent and adding to a record (as part of an update) impossible
I am trying to do a simultaneous update (using a single container from pylib) of:
- adding parent "SimulationOutput" to a file (id=169)
- adding the file to a LIST - property (id=156, name="output") of an existing record
This currently leads to an error: "Reference not qualified. The value of this Reference Property is to be a child of its data type." This would be correct if I had not added the parent in the first place. Somehow, the server does not take into account the simultaneously added parent during the type check for the property of the record.
If I do an ".update()" on both entries of the container separately, adding the parent first, the update transaction works.
(xml shortened):
<File id="169" path=".../SimulationOutput/run1/result.npy">
<Parent id="158" name="SimulationOutput"/>
</File>
,
<Record id="185" description="*[possibly short] description of the event*">
<Parent id="155" name="SimulationCase"/>
(...)
<Property id="156" name="output" importance="FIX" flag="inheritance:FIX">
<Value>169</Value>
</Property>
</Record>
Traceback (most recent call last):
File "/home/salexan/.local/bin/crawler2.0", line 33, in <module>
sys.exit(load_entry_point('newcrawler', 'console_scripts', 'crawler2.0')())
File "/home/salexan/Projekte/CaosDB/caosdb-newcrawler/src/newcrawler/crawl.py", line 759, in main
crawler.synchronize(commit_changes=True)
File "/home/salexan/Projekte/CaosDB/caosdb-newcrawler/src/newcrawler/crawl.py", line 327, in synchronize
return self._synchronize(self.updateList, commit_changes)
File "/home/salexan/Projekte/CaosDB/caosdb-newcrawler/src/newcrawler/crawl.py", line 611, in _synchronize
self.execute_updates_in_list(to_be_updated)
File "/home/salexan/Projekte/CaosDB/caosdb-newcrawler/src/newcrawler/crawl.py", line 578, in execute_updates_in_list
db.Container().extend(to_be_updated).update()
File "/home/salexan/Projekte/CaosDB/caosdb-pylib/src/caosdb/common/models.py", line 3316, in update
raise_errors(cresp)
File "/home/salexan/Projekte/CaosDB/caosdb-pylib/src/caosdb/common/models.py", line 4384, in raise_errors
raise transaction_error
caosdb.exceptions.TransactionError: TransactionError: One or more entities are not qualified. None of them have been inserted/updated/deleted.
+--| REASONS |--
| -> RECORD (id: 185) CAUSED |UnqualifiedPropertiesError: Entity has unqualified properties.
| +--| REASONS |--
| | -> PROPERTY (id: 156, name: 'output') CAUSED | |EntityError: Reference not qualified. The value of this Reference Property is to be a child of its data type.
| +----------------
+----------------