Query executer in logs

Hello everyone!

I found this error in a log, the console told me that is saving everything at one file but I found this too in the diagnostics window, says the same.

NonResponsiveEdt-2023-10-26_002939.json (136.6 KB)

Do you think that is a query? Both says in the status : WAITING

Yes, that would be you running an long query from a foreground script (event script, runScript() expression function, et cetera). Don't do that--it locks up the UI.

Use named query bindings. Those run the query in the background safely. Or you can learn to use invokeAsynchronous, but many people do not have the discipline to avoid interacting with UI components from the background, which has its own crash risks.


In the case of this particular thread dump, it's a button's actionPerformed event. But the main point stands.


By calling in a button or textfield as runnamedquery function that I have created in the part of the named queries . Will be a foreground script? or it is fine use like that?

It is not fine. If a script calls a named query, the NQ runs in the script environment. Only a NQ binding runs in the background by default.

It is reasonable for a button's actionPerformed event to run a small UPDATE or INSERT query to apply a user's changes to the DB.

But that event script should NOT run the follow-up query to obtain fresh data to display. The script should use system.db.refresh() to cause a non-polling NQ binding to re-execute to get the fresh display data. Or, if the query is too complex or varied to be run from a binding, then system.util.invokeAsynchronous() should be used to run a separate function for all of that. (But obey the rules for setting the results back into the UI.)

1 Like