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

View: New views
20 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


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.


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Andy Jefferson updated JDO-623:
-------------------------------

    Attachment: query_timeout.patch

Patch for Query API changes, JDOQueryTimeoutException, JDOQueryInterruptedException, and associated changes for PMF property.

I've made the timeout value as milliseconds so we have sufficient granularity to cater for all eventualities. Anyone prefer seconds?

> 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.


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ 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.


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Guido Anzuoni commented on JDO-623:
-----------------------------------

Since Query.cancel()  cannot be invoked from the thread which started the execution, should PM.setMultithreaded(true) be invoked ?
If setMultithreaded(true) is mandatory, should cancel() throw an Exception if multithreaded flag is false?
Is it the case to handle Query.cancel()  without multithreaded flag being true ?

> 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.


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

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

> Since Query.cancel() cannot be invoked from the thread which started the execution, should PM.setMultithreaded(true) be invoked ?

No, multithreaded is intended to require that the implementation protect data structures from harm in case multiple threads are active in data structures visible to the application. Query.cancel doesn't operate on visible data structures.

> If setMultithreaded(true) is mandatory, should cancel() throw an Exception if multithreaded flag is false?

No.

> Is it the case to handle Query.cancel() without multithreaded flag being true ?

Yes. Since the thread that is stuck in a query can't be simultaneously modifying data structures, normal care is all that's needed by the implementation to avoid corruption.



> 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.


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

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

Changes are now in SVN, including Craigs method renaming including "Millis" for clarity

> 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.


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

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

Suggested spec updates :-
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. If it is not specified then the implementation won't set any timeout (unless specified on a query-by-query basis).
</spec>

11.1.1
Add
"javax.jdo.option.QueryTimeoutInMillis"

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 PersistenceManagerFactory property value (see 11.1)

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: 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.


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ 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.


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

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

Patch was applied to SVN trunk.

> 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.


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Matthew T. Adams commented on JDO-623:
--------------------------------------

I think we need an overloaded method here, cancel(Thread), and possible an additional method, cancelAll().

In the event that a user shares a single Query instance across multiple threads, each of which is calling execute() in parallel, there is no way for the thread calling cancel to communicate to the implementation exactly which thread's running query to cancel.  This implies that there needs to be an overload that takes a Thread instance:  cancel(Thread).

This has implications on Query#execute():  the implementation must note which Thread a query execution is executing on.  This would allow the user to call cancel() in the simple, more common use case of only one query execution thread, as there would be only one execution recorded, and it would be the one to be cancelled.  However, in the more complicated use case of multiple, concurrent executions, cancel() could either cancel all current executions, or throw a JDOUserException indicating an ambiguous cancellation request.  If we decide that the method should throw, then another convenient method would be cancelAll().

> 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.


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Michael Bouschen commented on JDO-623:
--------------------------------------

In order to close this we need a TCK test for Query cancel and timeout support and this is a challenge:
- The test case does not know whether the implementation supports Query.cancel. So do we need a PMF supported option (e.g. javax.jdo.option.CancelQuery) to test this?
- What kind of query is guaranteed to run long enough such that a parallel thread is able to cancel it?
- The same hold true for a method testing the query timeout.

> 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.


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Andy Jefferson updated JDO-623:
-------------------------------

    Attachment: query.patch

Patch to rename Query.cancel to Query.cancelAll, and add Query.cancel(Thread)

> 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.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.


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Andy Jefferson updated JDO-623:
-------------------------------

    Attachment:     (was: query.patch)

> 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.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.


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Andy Jefferson updated JDO-623:
-------------------------------

    Attachment: query.patch

Updated javadoc relative to previous patch to allow for case of cancel failing

> 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.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.


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Andy Jefferson updated JDO-623:
-------------------------------

    Attachment: pmf_option.patch

Patch for PMF property of supported option

> 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, 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.


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Andy Jefferson updated JDO-623:
-------------------------------

    Assignee:     (was: Andy Jefferson)

Patches to Query and PersistenceManagerFactory were applied to SVN trunk.
Remaining work is for tests.

> 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, 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.


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Michael Bouschen reassigned JDO-623:
------------------------------------

    Assignee: Michael Bouschen

> 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: Michael Bouschen
>             Fix For: JDO 2 maintenance release 3
>
>         Attachments: JDO-623-mbo.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.


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ 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-tck2-mbo.patch

Attached you find a patch for review adding two new tck2 test classes:
- QueryCancel
- QueryTimeout

I haven't added the two new test classes to the tck conf files. The current datanuclues JDOQL implementation does not support query canceling and the alternate implementation of JDOQL that will eventually replace the current one is not yet finished.

In order to include the test classes add the following lines to the property jdo.tck.classes in query.conf:
org.apache.jdo.tck.query.api.QueryCancel \
org.apache.jdo.tck.query.api.QueryTimeout

> 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: Michael Bouschen
>             Fix For: JDO 2 maintenance release 3
>
>         Attachments: JDO-623-mbo.patch, JDO-623-tck2-mbo.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.


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

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

Nice work as usual.

Just one comment: there are TODO items that are apparently resolved already.


> 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: Michael Bouschen
>             Fix For: JDO 2 maintenance release 3
>
>         Attachments: JDO-623-mbo.patch, JDO-623-tck2-mbo.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.


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

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Michael Bouschen commented on JDO-623:
--------------------------------------

Checked in the patch adding the TCK test cases (see revision 804355).

I haven't added the two new test classes to the tck query.conf file. This needs to be done as soon as the datanucleus default JDOQL implementation supports query canceling. I keep the JIRA issue unresolved until then.

> 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: Michael Bouschen
>             Fix For: JDO 2 maintenance release 3
>
>         Attachments: JDO-623-mbo.patch, JDO-623-tck2-mbo.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.

< Prev | 1 - 2 | Next >