Dear Experts,

I am using JAVA JENA 264. I need to set execution time out in a particular
SELECT query
(which is coming from some iterative queries). That is, for example, if a
particular SELECT query execution time is more than 5 Mins, I will go for
another query. Code snippet could be as below:

-----------------------
String query = ".... ";
Query sparql1 = QueryFactory.create(query, Syntax.syntaxSPARQL_11);
VirtuosoQueryExecution vqe1 = VirtuosoQueryExecutionFactory.create(sparql1,
dataset);
ResultSet results1 = vqe1.execSelect();

----------------------

I researched that there might be a method in VirtuosoQueryExecution
possibly named
"settimeout". However, with Jena 264, I not finding such method. Can you
please guide me.

By the way,

I tried work-around by setting up connection time for dataset, such as

---------------------

VirtGraph dataset = new VirtGraph (url, "dba", "dba");
            try {
            dataset.getConnection().createStatement().execute("set
result_timeout = 300000");
            }
            catch(SQLException e) {
                e.printStackTrace();
            }
-------------------------

However, it does not suffice my requirement because, if I do so, in some
cases, my query gets executed but I have not finish catching result from
the ResultSet. So, I need, if execution is finished (i.e.,
vqe1.execSelect(); successfully finished within 5 Mins), I want to catch my
result. But with this work-around, I can not catch my ResultSet.



-
Regards
Mizanur
NII, Japan

Reply via email to