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

Craig Russell commented on JDO-623:
-----------------------------------

This is a good addition to the spec.

Most pmf properties are capitalized, so the pmf property would be 
javax.jdo.option.QueryTimeout, as you have put into your patch.

We have all of the standard properties also in the PMF API. Question for 
discussion: should we add get/setQueryTimeout to the API?

If the user or administrator cancels a query via an external (e.g. JDBC) API, 
should the same QueryInterruptus exception be thrown?

Milliseconds is a good unit of measuremant for the timeout. Many drivers 
support millis, and the JDBC expert group seems to be moving in that direction. 
My biggest concern is usability, so I might even consider QueryTimeoutMillis to 
make is very clear that it's millis. And Query.get/setTimeoutMillis, 
PMF.get/setQueryTimeoutMillis. I'd draw the line at QueryInterruptedMillis 
though. ;-)



> 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
>            Assignee: Andy Jefferson
>             Fix For: JDO 2 maintenance release 3
>
>         Attachments: 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.

Reply via email to