A tag with an associated listener causes issues in DelayedWrite transactions
When a tag that is associated with a listener is denied through a DelayedWrite transaction, the listener is no longer called and the cache somehow gets into a state that persistently reports the existence of the statement, despite the denied status, visible on the Graph debugger.
Utility function:
import "Simantics/All"
addListener resource tag = syncRead \() -> subqueryL
(existsStatement3 resource tag resource)
(\result -> print "Listener called: \(result)")
(\(e :: Throwable) -> print "Exception \(e)")
False
On SCL console:
> m = resource "http://Projects/Development%20Project/Model"
> tag = L0.Deprecated
> existsStatement3 m tag m
False
> addListener m tag
Listener called: True
> claim m tag m
Listener called: True [in stdout]
> deny m tag m
Listener called: False [in stdout]
> existsStatement3 m tag m
False
> claim m tag m
Listener called: True [in stdout]
> existsStatement3 m tag m
True
> delayedSyncWrite \() -> deny m tag m
[no prints in stdout]
> existsStatement3 m tag m
True
> deny m tag m
[no prints in stdout]
> existsStatement3 m tag m
True
When the delayedSyncWrite
is made, the listener is no longer called, also for any subsequent attempts to either claim or deny the statement, and existsStatement3
continues to report a value True
even though the Graph debugger is not showing the presence of the statement.
When the platform is restarted, the statement is again reported as non-existent.
This might also affect some other statements besides tags.