You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by "Andy Jefferson (JIRA)" <ji...@apache.org> on 2010/03/23 19:10:27 UTC

[jira] Commented: (JDO-623) Query cancel and timeout support

    [ https://issues.apache.org/jira/browse/JDO-623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848828#action_12848828 ] 

Andy Jefferson commented on JDO-623:
------------------------------------

Rerun test. Still fails. 
SELECT AVG((A0.X + VAR_POINT2.Y)) FROM DATASTOREIDENTITY0.PCPOINT A0,DATASTOREIDENTITY0.PCPOINT2 VAR_POINT2 WHERE A0.Y >= 0 AND VAR_POINT2.X >= 0
Execution Time = 44 ms

If you want to try it yourself, use DN nightly jars 2.1.0-m1-SNAPSHOT of "datanucleus-core" and "datanucleus-rdbms".

PS. Derby does some weird stuff in the JDBC call ResultSet.next() which hangs for 10seconds or so on this query. Presumably it evaluates the AVG of that query at that point, so hence the actual query execution is "fast", and hence a timeout is pointless.

> Query cancel and timeout support
> --------------------------------
>
>                 Key: JDO-623
>                 URL: https://issues.apache.org/jira/browse/JDO-623
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, tck2
>            Reporter: Andy Jefferson
>             Fix For: JDO 2 maintenance release 3
>
>         Attachments: JDO-623-mbo.patch, JDO-623-tck2-mbo.patch, JDO-623-testcase.patch, JDO-623-ZeroTimeoutTestcase.patch, jdo623.patch, jdo623.patch, pmf_option.patch, query.patch, query_timeout.patch
>
>
> JDO doesn't have a mechanism to stop queries from overrunning. JPA2 now allows 
> a persistence property to allow timing them out, and most JDO implementations 
> have allowed this as an extension since JDO1. It would make sense for JDO 
> (2.3) to have the same or a variation. I propose having the following
> Simple PMF property "javax.jdo.option.queryTimeout" to specify the number of millisecs (or secs) before any query is timed out. Throw a QueryTimeoutException (extends JDOException) when the timeout happens.
> Add methods Query.setTimeout(int), Query.getTimeout() to allow setting/retrieving the timeout interval on a per-query basis.
> Add method Query.cancel() to cancel any running query. If an implementation doesn't support cancelling of queries then it should throw a JDOUnsupportedOptionException. Any query execute() that is cancelled will throw a QueryInterruptedException (extends JDOUserException).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.