Skip to content

Dirty reads during write transactions cause problems in ResourceURIToVariable queries during MigrateModel

MigrateModel.MigrationOperation.replace performs L0.InstanceOf and relation replacements by first removing the existing relation, and then adding the replacing relation.

This causes problems with IMMEDIATE_UPDATE type queries (e.g. #1184 (closed)) because they will start updating queries immediately the replacement has been written. The total removal of InstanceOf will cause an unexpected crash in ResourceURIToVariable which breaks updates for other crucial queries that rely on ResourceURIToVariable and they will not get updated anymore after the correct InstanceOf is reinstated.

The simplest workaround at this point is to just change the code to perform the deny and claim in a different order, i.e. claim new relation first, then deny the old relation. This doesn't break ResourceURIToVariable although it can arguably cause it to malfunction.

TODO: add exception