You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Mauricio Orellana <ma...@gmail.com> on 2015/03/24 02:29:35 UTC

explore endpoint with many queries

Is there any constraint about requests number in apache jena?
I need to do a lot of requests from jena to an endpoint, but the process 
never gets finished.

The problem is in method execSelect() of class QueryExecution, when I 
call this method a lot of times, my program doesn't reciev more data.

Thanks in advance.

Re: explore endpoint with many queries

Posted by Mauricio Orellana <ma...@gmail.com>.
Arsham, I was doing a simple query...
Rob has reason, the problem was the number of connections.

Thank you




On 24/03/15 06:52, Rob Vesse wrote:
> Jena uses Apache HttpClient which does place limits on the number of
> connections - see
> https://hc.apache.org/httpcomponents-client-ga/tutorial/html/connmgmt.html
> - specifically section 2.3
>
> Additionally the remote server may place constraints on its services to
> stop users abusing the service and affecting other users
>
> You haven't told us much about what you actually do, if you run lots of
> queries in parallel then you may be hitting rate/resource limits on either
> the client or the remote server side.
>
> It is also worth noting that calling execSelect() on a QueryExecution does
> not close the connection automatically, it returns a ResultSet which will
> stream the results returned by the remote server back to you on demand.
> So every unclosed QueryExecution object you have obtained is holding a
> HTTP connection open, you either need to process the results by iterating
> and closing the associated QueryExecution or if you don't want to do the
> processing immediately take an in-memory copy and close the QueryExecution
> e.g.
>
> ResultSet copy = ResultSetFactory.makeRewindable(qe.execSelect());
> qe.close();
>
> Rob
>
> On 24/03/2015 04:27, "Arsham Mesbah"<ar...@uga.edu>  wrote:
>
>> No constraint but there is a timeout period, i.e if your query is takes a
>> longtime to finish then it is going to time out and you will not receive a
>> result. Does the query returns anything? Can your run the same query on an
>> endpoint and limit the rows returned to some small # to make sure it
>> returns something?
>>
>> On Mon, Mar 23, 2015 at 6:29 PM, Mauricio Orellana
>> <ma...@gmail.com>
>> wrote:
>>
>>> Is there any constraint about requests number in apache jena?
>>> I need to do a lot of requests from jena to an endpoint, but the process
>>> never gets finished.
>>>
>>> The problem is in method execSelect() of class QueryExecution, when I
>>> call
>>> this method a lot of times, my program doesn't reciev more data.
>>>
>>> Thanks in advance.
>>>
>>
>>
>> -- 
>> Arsham Mesbah
>> University of Georgia
>> Department of Computer Science
>> Franklin College of Arts and Sciences
>> 415 Graduate Studies Research Center
>> Athens, GA 30602
>
>
>


Re: explore endpoint with many queries

Posted by Rob Vesse <rv...@dotnetrdf.org>.
Jena uses Apache HttpClient which does place limits on the number of
connections - see 
https://hc.apache.org/httpcomponents-client-ga/tutorial/html/connmgmt.html
- specifically section 2.3

Additionally the remote server may place constraints on its services to
stop users abusing the service and affecting other users

You haven't told us much about what you actually do, if you run lots of
queries in parallel then you may be hitting rate/resource limits on either
the client or the remote server side.

It is also worth noting that calling execSelect() on a QueryExecution does
not close the connection automatically, it returns a ResultSet which will
stream the results returned by the remote server back to you on demand.
So every unclosed QueryExecution object you have obtained is holding a
HTTP connection open, you either need to process the results by iterating
and closing the associated QueryExecution or if you don't want to do the
processing immediately take an in-memory copy and close the QueryExecution
e.g.

ResultSet copy = ResultSetFactory.makeRewindable(qe.execSelect());
qe.close();

Rob

On 24/03/2015 04:27, "Arsham Mesbah" <ar...@uga.edu> wrote:

>No constraint but there is a timeout period, i.e if your query is takes a
>longtime to finish then it is going to time out and you will not receive a
>result. Does the query returns anything? Can your run the same query on an
>endpoint and limit the rows returned to some small # to make sure it
>returns something?
>
>On Mon, Mar 23, 2015 at 6:29 PM, Mauricio Orellana
><ma...@gmail.com>
>wrote:
>
>> Is there any constraint about requests number in apache jena?
>> I need to do a lot of requests from jena to an endpoint, but the process
>> never gets finished.
>>
>> The problem is in method execSelect() of class QueryExecution, when I
>>call
>> this method a lot of times, my program doesn't reciev more data.
>>
>> Thanks in advance.
>>
>
>
>
>-- 
>Arsham Mesbah
>University of Georgia
>Department of Computer Science
>Franklin College of Arts and Sciences
>415 Graduate Studies Research Center
>Athens, GA 30602





Re: explore endpoint with many queries

Posted by Arsham Mesbah <ar...@uga.edu>.
No constraint but there is a timeout period, i.e if your query is takes a
longtime to finish then it is going to time out and you will not receive a
result. Does the query returns anything? Can your run the same query on an
endpoint and limit the rows returned to some small # to make sure it
returns something?

On Mon, Mar 23, 2015 at 6:29 PM, Mauricio Orellana <ma...@gmail.com>
wrote:

> Is there any constraint about requests number in apache jena?
> I need to do a lot of requests from jena to an endpoint, but the process
> never gets finished.
>
> The problem is in method execSelect() of class QueryExecution, when I call
> this method a lot of times, my program doesn't reciev more data.
>
> Thanks in advance.
>



-- 
Arsham Mesbah
University of Georgia
Department of Computer Science
Franklin College of Arts and Sciences
415 Graduate Studies Research Center
Athens, GA 30602