Closed egli closed 3 years ago
The first solution would imply locking of the entire dictionary_unknownword
table (as we delete all records at the beginning of the request). Don't know if we want that.
The second solution would require to drop the sort-of lazy approach to emptying the dictionary_unknownword
table. We'd have to clean up after ourselves right within the request.
This doesn't work as currently implemented. We also need to change the query to get the unknown words.
This doesn't work as currently implemented. We also need to change the query to get the unknown words.
And the change is quite substantial, as the query is huge to begin with and the additional AND unknown.document_id = :document-id
would have to be added in numerous places.
It seems much simpler to just use transaction isolation and add a simple with-transaction
around the deletion and select
daisyproducer2.words.unknown/get-words
first deletes the whole tabledictionary_unknownword
, inserts all words from the document and finally does a join withdictionary_localword
anddictionary_globalword
.If another process happens to invoke
get-words
at the same time you're bound to run into trouble.Any of the following might work as a solution:
document_id