Function: isOsfqlTermChangedConcurrently()
@kortexya/reasoninglayer / isOsfqlTermChangedConcurrently
Function: isOsfqlTermChangedConcurrently()
Section titled “Function: isOsfqlTermChangedConcurrently()”isOsfqlTermChangedConcurrently(
error):error is OsfqlError
Defined in: src/errors.ts:454
Whether error is the OSFQL answer to a lost commit: another writer changed
a term the program read before the program committed (reasoninglayer#1268).
Parameters
Section titled “Parameters”unknown
Anything caught from an SDK call.
Returns
Section titled “Returns”error is OsfqlError
true when error is an OsfqlError whose errorType is
term_changed_concurrently; false otherwise.
Remarks
Section titled “Remarks”osfql.execute answers it with HTTP 409; the message names the term.
Nothing of the program is written, and reading again and retrying is safe.
The other program doors (cypher, gql, gremlin, the ontology import,
scenarios, …) answer the same conflict as the coded 409 body; test that
one with isTermChangedConcurrently.
Example
Section titled “Example”try { await client.osfql.execute('UPDATE order(id: 1) SET paid: 3;');} catch (e) { if (isOsfqlTermChangedConcurrently(e)) retry();}