Fixed SCLScriptAnnotationModel script validation threading 83/1183/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 2 Nov 2017 13:37:32 +0000 (15:37 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 2 Nov 2017 13:37:32 +0000 (15:37 +0200)
commit2bc508bb935f99de104bd25935f23c474de7f1ca
tree470536f2c5c02dba60498c8acb26d6fbba7b0620
parent123ffb4e766047e37270bfffd46363ac85cdc4f9
Fixed SCLScriptAnnotationModel script validation threading

Previously the code performed the script validation directly in the DB
listener thread, which is essentially QueryThread-0 without putting the
related ReadGraph into the current SCLContext while doing so. This
caused the validation code to crash because the validation code tries to
start a new database transaction from within the transaction thread
calling the listener.

The solution schedules the validation to a BUILD priority Job thread.

refs #7450

Change-Id: I01c030be032890638919c3800e04e14670f8726c
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/scl/scriptEditor/SCLScriptAnnotationModel.java