On 20/06/11 17:32, Dalkandura Arachchige Gunaratna wrote:
Hi, I am using Jena ARQ API to query DBpedia dataset using a sparql
endpoint. I want to set the timeout limit for querying using a java
program so that the program will not crash if sufficient timeout is set.
My intention is to have a simple loop to handle so that if an exception
happens, the query will be re-done.

I have come across a code sample to set timeout in the internet and
I
am not sure whether this works correctly. Is this correct or there is
any other way of doing this?

         QueryEngineHTTP qexec = (QueryEngineHTTP) 
QueryExecutionFactory.sparqlService(
                 strSparqlEndpoint, qExecuteQuery);
         qexec.addParam("timeout","10000");

Kalpa Gunaratna




QueryEngineHTTP itself does not support timeouts:

https://issues.apache.org/jira/browse/JENA-56

This would be timeout at the local end anyway - in the dbpedia.org (if that is what you are querying) then the timeout can be set so the server times the query out. See the documentation for dbpedia and Virtuoso.

In either case, retrying a query is unlikely to be a good strategy - if the query timeouted once, why won't it timeout the next time as well?

        Andy

Reply via email to