# Recall or Cancel Active Query from Application

**URL:** <https://forum.inductiveautomation.com/t/recall-or-cancel-active-query-from-application/38713>\
**Category:** Ignition\
**Tags:** namedqueries, database, perspective\
**Created:** [September 15, 2020, 8:21pm UTC](https://forum.inductiveautomation.com/t/recall-or-cancel-active-query-from-application/38713 "2020-09-15T20:21:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcaudle](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@jcaudle](https://forum.inductiveautomation.com/u/jcaudle)\
**Post date:** [September 15, 2020, 8:21pm UTC](https://forum.inductiveautomation.com/t/recall-or-cancel-active-query-from-application/38713/1 "2020-09-15T20:21:16Z")

</div>

When the application runs a complex runNamedQuery and the result generally will take several minutes to return from SQL Server, _how can one issue a query cancel request from the application?_

Example: User doesn’t realize they set the date range to be a decade instead of a week… The query will happily return in an hour but they don’t want to wait. They close the perspective app but the gateway keeps a thread waiting on the query result. Maybe the user could hit a cancel button?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 15, 2020, 9:48pm UTC](https://forum.inductiveautomation.com/t/recall-or-cancel-active-query-from-application/38713/2 "2020-09-15T21:48:58Z")

</div>

DB connections have a timeout setting, and most databases have their own internal timeouts. JDBC allows setting a timeout in seconds on a statement just before executing it. Deciding after a query starts is simply not supported.

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [September 15, 2020, 10:19pm UTC](https://forum.inductiveautomation.com/t/recall-or-cancel-active-query-from-application/38713/3 "2020-09-15T22:19:24Z")

</div>

What Phil said. Also see [this thread](http://forum.inductiveautomation.com/t/question-canceling-active-queries-on-the-gateway/26026/2) – even in the gateway it’s not really supported even though we have an enticing button for you to push.

---

<div class="post-metadata">

**Author:** ![jcaudle](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@jcaudle](https://forum.inductiveautomation.com/u/jcaudle)\
**Post date:** [September 16, 2020, 11:59am UTC](https://forum.inductiveautomation.com/t/recall-or-cancel-active-query-from-application/38713/4 "2020-09-16T11:59:45Z")

</div>

Thank you for the quick replies.  
To my knowledge the timeout on a statement cannot be changed after its fired so that would not serve the same purpose.

Kathy,  
I saw your other post. Can one push the enticing cancel button from the designer or app?

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [September 16, 2020, 1:44pm UTC](https://forum.inductiveautomation.com/t/recall-or-cancel-active-query-from-application/38713/5 "2020-09-16T13:44:54Z")

</div>

> [@jcaudle](#):
>
> Can one push the enticing cancel button from the designer or app?

No, and it's unlikely we'll add it because of the reasons outlined in the other post.

If this is a frequent enough problem, you might need to add some scripting guards to your button logic. Yes, the user would have to dismiss an extra popup if they really did want a decade, but that would be rare.
