When storing new terms, while cleaning up others in parallel, it can happen that some of those terms may overlap and this can result into an inconsistent state of records in new schema tables, esp. that we do not use foreign keys constraints in this schema.
BDD
Given some terms exist in db
And two requests in-parallel
And one of the requests is storing new terms
And the other request is cleaning up other terms
And the new terms and other terms intersect over some terms that exist in db
When the two in-parallel requests are done
And all post-request updates for them have finished
Then I should see in db all new terms, from the first request
And I should not see in db terms that are part of other terms but are not part of new terms