Is there any way to cancel a running query ?

Forum to discuss the Web client version of Servoy.

Is there any way to cancel a running query ?

Postby markhooper » Tue Dec 09, 2008 6:43 pm

I have two questions...

#1) Is there any way to cancel a query that has already started ?
For example, let's say a user puts a form into 'find' mode, specifies some search criteria then initiates a 'search' and then wants to cancel the running query. Is this possible in any way via Servoy ?


#2) Is there any way to cancel out of 'find' mode ?
Same situation as above in that the user puts a form into 'find' mode and then decides they don't want to be in 'find' mode afterall.
Can they cancel out of 'find' mode ? If so, will the previously queried data remain ?
markhooper
 
Posts: 84
Joined: Fri May 30, 2008 7:28 pm
Location: Canada

Re: Is there any way to cancel a running query ?

Postby jcompagner » Fri May 15, 2009 2:17 pm

about 1:

servoy doesnt support this, there is support for cancel at the java level (but this is totally dependend if the driver/database also supports this so it doesnt have to do anything)
So in a next version we could support cancel (if the db supports it) if needed.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Is there any way to cancel a running query ?

Postby Andrei Costescu » Fri May 15, 2009 3:01 pm

about 2:

You can discard find mode using ESC, "Show all" menu item, javascript call to controller.loadAllRecords(). But it is not exactly a cancel (it performs the search to exit find mode and then loads all records).
And it will not go back to pervious query, but rather show all records.

You can create a case in our support system to request a genuine cancel find operation.
http://crm.servoy.com/servoy-webclient/solutions/solution/servoy_support
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Is there any way to cancel a running query ?

Postby markhooper » Thu May 28, 2009 1:49 am

Enhancement request submitted :)
markhooper
 
Posts: 84
Joined: Fri May 30, 2008 7:28 pm
Location: Canada

Re: Is there any way to cancel a running query ?

Postby achiary » Wed Feb 17, 2010 12:01 am

markhooper wrote:Enhancement request submitted :)


Was this enhancement request implemented ? I mean : how to cancel current find without loosing foundset contents.
achiary
 
Posts: 83
Joined: Wed Nov 14, 2007 3:29 pm
Location: Argentina

Re: Is there any way to cancel a running query ?

Postby paulc » Thu Feb 25, 2010 11:53 pm

Hi,

I was wondering if there has been any progress made on the enhancement? I would like to exit out of find mode programatically. But, after searching through all of the forums I am unable to see any progress made on this enhancement. Could anyone out there provide me with a snippet of code that could allow a user to cancel a find without performing a search?

Thank you
paulc
 
Posts: 55
Joined: Wed Feb 17, 2010 8:58 pm

Re: Is there any way to cancel a running query ?

Postby jcompagner » Fri Feb 26, 2010 12:22 am

no there is not progress on this
And this will also not be very easy to do. There are loads of issues with this not all in the hand of server.

If you do a find. Then that find is send to the server, then if you want to cancel that one, we have to call the server again with another call
that really targets that other first one. Then get there the connection/statement that is used by that specific thing.
Then call Statement.cancel() and then hope that the jdbc driver or the database really implement and support it..
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Is there any way to cancel a running query ?

Postby ROCLASI » Fri Feb 26, 2010 12:41 am

Johan,

I think the last posts were about the original poster's question #2. So about how to get out of find mode (no query running yet whatsoever) and keep the original foundset that existed before coming into findmode.
That's all in the hands of Servoy client and perhaps Server.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Is there any way to cancel a running query ?

Postby paulc » Fri Feb 26, 2010 12:47 am

Hi Johan,

Thank you for the information. I understand what you are saying.

Another question related to this would be, is there any way to cancel the controller find mode when it has not been run/executed? I have users that may put a form into find mode, but then decide that they no longer wish to run a find. All they would want to see is the existing foundset without having to run another search to exit find mode.

Thanks
paulc
 
Posts: 55
Joined: Wed Feb 17, 2010 8:58 pm

Re: Is there any way to cancel a running query ?

Postby pbakker » Fri Feb 26, 2010 9:47 am

Pressing escape should cancel the find.

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Re: Is there any way to cancel a running query ?

Postby paulc » Fri Feb 26, 2010 6:23 pm

Hi pbakker,

i have read that using the escape key works, but I need that functionality to be assigned to a button for users. I have tried the escape key and it doesn't seem to work in the solution that I am working on, which is fine, as we are looking to utilize code to handle this functionality.

Any ideas on what the code might be to achieve this same functionality as pressing the "ESC" key?
Currently I am using the following code, but it still performs a search.

Code: Select all
forms.list.foundset.find();

if (columnValue == null)
      forms.list.controller.search(null, null);
else
      forms.list.foundset.search();


Thanks
paulc
 
Posts: 55
Joined: Wed Feb 17, 2010 8:58 pm

Re: Is there any way to cancel a running query ?

Postby jcompagner » Fri Feb 26, 2010 6:46 pm

currently the only thing escape does you also can do in code

controller.loadRecords()

that will cancel your find, but will result in a loadAllRecords.

We currently dont support going back to the foundset you where on before you started find.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Is there any way to cancel a running query ?

Postby paulc » Mon Mar 01, 2010 8:09 pm

Hi Johan,

I tried the controller.loadRecords() method you suggested, but it doesn't seem to cancel the form being in find mode. It seems to take about the same time as just running a search, and does not appear to have any sort of performance increase.

Are there any other work arounds for this problem?

Thanks
paulc
 
Posts: 55
Joined: Wed Feb 17, 2010 8:58 pm

Re: Is there any way to cancel a running query ?

Postby jcompagner » Tue Mar 02, 2010 10:07 am

a query will happen currently because search() will do a query with the search criteria and loadRecords() will do a query with just no where statement.
If you just want max performance with no queries you could try to do foundset.clear()
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Servoy Web Client

Who is online

Users browsing this forum: No registered users and 23 guests

cron