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

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

Changes to remove the old query timeout test and the changes to the signatures 
look good. I've run the tck with this patch and no signature issues.

testDatastoreWriteTimeout doesn't use the MAIN_SLEEP_MILLIS constant.

When I run on today's RI SNAPSHOT, it takes 10 seconds for the first test and 8 
seconds for the second test, which indicates that the timeout methods are not 
doing anything but the PMF method is returning the timeout option.

    [java] There were 2 failures:
    [java] 1) 
testDatastoreReadTimeout(org.apache.jdo.tck.api.persistencemanager.DatastoreTimeout)junit.framework.AssertionFailedError:
 Assertion A?? (DatastoreTimeout) failed: 
    [java] Query.setDatastoreReadTimeoutMillis should throw a 
JDOUnsupportedOptionException, if datastore timeout is not supported 
    [java]      at org.apache.jdo.tck.JDO_Test.fail(JDO_Test.java:682)
    [java]      at 
org.apache.jdo.tck.api.persistencemanager.DatastoreTimeout.runQueryReadingPCPointInstances(DatastoreTimeout.java:180)
    [java]      at 
org.apache.jdo.tck.api.persistencemanager.DatastoreTimeout.testDatastoreReadTimeout(DatastoreTimeout.java:96)
    [java]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [java]      at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [java]      at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [java]      at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:272)
    [java]      at 
org.apache.jdo.tck.util.BatchTestRunner.doRun(BatchTestRunner.java:108)
    [java]      at 
org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:148)
    [java]      at 
org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:123)
    [java] 2) 
testDatastoreWriteTimeout(org.apache.jdo.tck.api.persistencemanager.DatastoreTimeout)junit.framework.AssertionFailedError:
 Assertion A?? (DatastoreTimeout) failed: 
    [java] PM.setDatastoreWriteTimeoutMillis should throw a 
JDOUnsupportedOptionException, if datastore timeout is not supported 
    [java]      at org.apache.jdo.tck.JDO_Test.fail(JDO_Test.java:682)
    [java]      at 
org.apache.jdo.tck.api.persistencemanager.DatastoreTimeout.runUpdatePCointInstance(DatastoreTimeout.java:273)
    [java]      at 
org.apache.jdo.tck.api.persistencemanager.DatastoreTimeout.testDatastoreWriteTimeout(DatastoreTimeout.java:126)
    [java]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [java]      at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [java]      at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [java]      at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:272)
    [java]      at 
org.apache.jdo.tck.util.BatchTestRunner.doRun(BatchTestRunner.java:108)
    [java]      at 
org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:148)
    [java]      at 
org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:123)
    [java] FAILURES!!!


> 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, 
> JDO-623-testcase.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.

Reply via email to