Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Cancelling a running AO query

Igor Sereda [ALM Works]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 17, 2014

Is there a way to cancel a running AO query?

There are two cases:

  1. Synchronous cancelling from inside ActiveObjects.stream() and a callback. I don't see a good way, but probably just throwing an unchecked exception would do the trick.
  2. More importantly, asynchronous cancelling from another thread, especially at the stage when no rows have been served yet.

This functionality is required to correctly implement Activity Streams provider that observes the timeout. I would be very glad to hear if someone has solved this yet. We're keen to go around the API with reflection etc. to get what we need.

Thanks!
Igor

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

3 votes
Answer accepted
jhinch (Atlassian)
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 17, 2014

Your best options are to throw an unchecked exception for use case 1 and to just interupt the thread for use case 2. If the JDBC connection is waiting it should terminate on an interrupt. Reflection isn't going to help you in this situation and is strongly discouraged.

TAGS
AUG Leaders

Atlassian Community Events