db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Bouschen (JIRA)" <j...@apache.org>
Subject [jira] Updated: (JDO-623) Query cancel and timeout support
Date Sun, 22 Mar 2009 21:37:50 GMT

     [ https://issues.apache.org/jira/browse/JDO-623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Michael Bouschen updated JDO-623:
---------------------------------

    Attachment: JDO-623-mbo.patch

I would like to propose a few changes:
(1) Add methods set/getTimeoutMillis to the PersistenceManage interface.
(2) Methods set/getTimeoutMillis should use an Integer argument resp. return value instead
of the primitive type value. Then the getter can return null in case no timeout is specified.
(3) For completeness we should add the getter getTimeoutMillis to the Query interface.
I added a patch JDO-623-mbo.patch for review implementing the above changes.

Updated spec changes: 

11.1
Add "Query Timeout" (bold heading)
<spec>
If the query timeout is specified the implementation will use the supplied value as a timeout
for any queries where the underlying datastore supports it. The timeout is in milliseconds.
The specified value is used as default for all PersistenceManager instances obtained from
the factory. If it is not specified then the implementation won't set any timeout (unless
specified on the PersistenceManager or on a query-by-query basis).
</spec>

11.1.1
Add
"javax.jdo.option.QueryTimeoutInMillis"

12.6.3
Add at the end of section 12.6.3
<spec>
If the query timeout is specified the implementation will use the supplied value as a timeout
for any queries where the underlying datastore supports it. The timeout is in milliseconds.
The specified value overrides PersistenceManagerFactory property value (see 11.1). It is used
as default for all Query instances obtained from the factory. If it is not specified then
the implementation won't set any timeout (unless specified on a query-by-query basis).
</spec>

14.6
Add
"Timeout/Cancel" (bold heading)
void setTimeoutMillis(int interval);
This method sets the timeout for this query (in milliseconds) where the underlying datastore
supports it. If the datastore doesn't support timeouts then a JDOQueryTimeoutException is
thrown. This overrides the PersistenceManager property value (see 12.6.3).

void cancel();
This method allows the current query to be cancelled (if executing). If the implementation
does not support this operation (maybe due to lack of support in the underlying datastore)
then JDOUnsupportedOptionException is thrown.

> 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: JDO-623-mbo.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.


Mime
View raw message