Cancel running query through a script

Hi folks, how are you doing?

So I was thinking what if we could simply cancel current running query and fire newer one?

I faced this problem while fetching the data from cloud it was taking around 30-45 seconds to return and then suddenly other similar query would fire if user changes it’s filter before last query data returns.

So this way we could send cancel run query request to previous query. Also it’d be good to know the status that query is still running on the gateway. Thanks

Maybe there is a more clever solution, but I use an execute button. I have the user select and modify all the filters they want, then have them push an execute button so you don’t have premature queries executing. You can’t use a binding this way since any time a parameter is altered the query updates. I just get the filters, create the parameter list accordingly, then run system.db.runNamedQuery() and set the results to the data property of the table.

1 Like

This is a good way.

Alternatively you can use @pturmel 's Simulation Aids module. Just query all your rows into a dataset, then your dropdowns will filter with pseudo-sql using java on the dataset, so you’re also not re-querying every time.

2 Likes

I've been doing all of mine this way since I discovered @pturmel's awesome module! Makes it so there aren't slow queries firing each time someone wants to filter something.

2 Likes