db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Satheesh Bandaram <sathe...@Sourcery.Org>
Subject Re: [jira] Updated: (DERBY-31) Statement.setQueryTimeout() support.
Date Sat, 26 Feb 2005 17:56:05 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
I haven't reviewed the patch fully, but some comments I see are:<br>
<ol>
  <li>I don't see any test cases added to show the new behavior. I am
not sure if the cancel() part is working... Having test cases would
show the behavior.</li>
  <li>DMLs statements could also use timeouts... especially the
searched ones. I think we should handle executeUpdate() methods too.</li>
  <li>Shouldn't we put timer checking in a try/catch block? If the
query raises SQLException, could we leave the block without resetting
timer?<br>
  </li>
  <li>Shouldn't we handle the cases of PreparedStatement and
CallableStatement as well?</li>
  <li>Could we use java.util.TimerTask for timing part?</li>
</ol>
Satheesh<br>
<br>
Shreyas Kaushik wrote:
<blockquote cite="mid421F0135.80601@Sun.com" type="cite">I have
implemented this for a SQL Query timeout. I thought this is not
applicable to insert and update timeouts ( I donno
  <br>
if there is something like that and how do we set that ). This is for
*queries only* .
  <br>
  <br>
What my patch addresses is the closing of the activation for that
statement when there is a timeout. It is the activation that
  <br>
holds the key to all the stuff below it( includes the ResultSets) so by
closing the activation all the tree of ResultSet and
  <br>
other resources should get released. I did a memory profiling after
doing this patch and it did not detect any memory leaks.
  <br>
  <br>
thanks
  <br>
Shreyas
  <br>
  <br>
Ali Demir wrote:
  <br>
  <br>
  <blockquote type="cite">Thank you!
    <br>
    <br>
How does the internals work? Does the cancelled query release all the
locks it might have been holding? Does it only work for this kind of
select? What if it were waiting for another insert/update transaction?
Would it still be able to cancel the select and return?
    <br>
    <br>
Regards,
    <br>
Ali
    <br>
    <br>
    <br>
At 09:28 PM 2/23/2005, you wrote:
    <br>
    <br>
    <blockquote type="cite">&nbsp;&nbsp;&nbsp;&nbsp; [
<a class="moz-txt-link-freetext" href="http://issues.apache.org/jira/browse/DERBY-31?page=history">http://issues.apache.org/jira/browse/DERBY-31?page=history</a>
]
      <br>
      <br>
Shreyas Kaushik updated DERBY-31:
      <br>
---------------------------------
      <br>
      <br>
&nbsp;&nbsp;&nbsp; Attachment: Derby-31.patch
      <br>
      <br>
This is the patch for implementing setQueryTimeout() in&nbsp;
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.
      <br>
      <br>
&gt; Statement.setQueryTimeout() support.
      <br>
&gt; ------------------------------------
      <br>
&gt;
      <br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Key: DERBY-31
      <br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
URL: <a class="moz-txt-link-freetext" href="http://issues.apache.org/jira/browse/DERBY-31">http://issues.apache.org/jira/browse/DERBY-31</a>
      <br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Project: Derby
      <br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type:
New Feature
      <br>
&gt;&nbsp;&nbsp; Components: JDBC
      <br>
&gt;&nbsp; Environment: ALL
      <br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; Reporter: Ali Demir
      <br>
&gt;&nbsp; Attachments: Derby-31.patch, QueryTimer.java
      <br>
&gt;
      <br>
&gt; Calling Statement.setQueryTimeout() throws exception saying that
function is not supported. This is an important JDBC feature and is
limiting our options to use Derby with our JDBC code. Implementing this
JDBC function would make Derby much easier to adopt.
      <br>
      <br>
--&nbsp;<br>
This message is automatically generated by JIRA.
      <br>
-
      <br>
If you think it was sent incorrectly contact one of the administrators:
      <br>
&nbsp;&nbsp; <a class="moz-txt-link-freetext" href="http://issues.apache.org/jira/secure/Administrators.jspa">http://issues.apache.org/jira/secure/Administrators.jspa</a>
      <br>
-
      <br>
If you want more information on JIRA, or have a bug to report see:
      <br>
&nbsp;&nbsp; <a class="moz-txt-link-freetext" href="http://www.atlassian.com/software/jira">http://www.atlassian.com/software/jira</a>
      <br>
    </blockquote>
    <br>
    <br>
    <br>
  </blockquote>
  <br>
  <br>
</blockquote>
</body>
</html>


Mime
View raw message