db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@debrunners.com>
Subject Re: [jira] Updated: (DERBY-31) Statement.setQueryTimeout() support.
Date Sat, 26 Feb 2005 17:56:29 GMT
Shreyas Kaushik (JIRA) wrote:

>      [ http://issues.apache.org/jira/browse/DERBY-31?page=history ]
> 
> Shreyas Kaushik updated DERBY-31:
> ---------------------------------
> 
>     Attachment: Derby-31.patch
> 
> This is the patch for implementing setQueryTimeout() in  EmbedStatement.java . I clsoe
the activation for the statement when the query times out so that the query stops executing.
I tested this by inserting data into a table continuosly for about 12 hours and then doing
a select * on it by setting the time out to 1 sec. It worked fine by cancelling the statement
execution when the timeout happened.
> 

I think a detailed explanation of what you believe cancel and
setQueryTimeout functionality should be would be very useful. I'm not
sure closing the activation actually results in the expected behaviour.

I also think the timing should be centralized per database or per
system, using java.util.Timer and TimerTask. With your implementation a
Thread per statement will be created when using query timeouts. Creating
threads is expensive in Java and there was a request against Cloudscape
to create one background thread per system, rather than the current case
of one per database. This is to handle the situation where there are
hundreds or thousands of databases per system.

Dan.


Mime
View raw message