On Mon, Aug 27, 2012 at 10:14 AM, Damian Steer <[email protected]> wrote:
>
> On 27 Aug 2012, at 17:17, Rob Vesse <[email protected]> wrote:
>
>> On 8/26/12 11:18 AM, "Andy Seaborne" <[email protected]> wrote:
>
>>> And on a related note, I wonder if execSelect or even deeper in
>>> HttpQuery.exec should read the entire response, and not try to do
>>> end-to-end streaming.  That way, a slow/bad application can't affect the
>>> remote server by holding connections open for too long.  Obvious down
>>> side is that things are resource limited
>>
>> I would disagree, while this is a useful idea in principal and in some use
>> cases it quickly falls down as soon as you have moderately large results
>> with a OOM exception.
>
> Would it be possible to use a buffer? For small-ish result sets you would get 
> the behaviour Andy suggests, but avoid the OOM issue.
>

Something like setFetchSize() [1]?  Oracle [2] defaults to 10 rows,
while PostgreSQL [3] and MySQL [4] both buffer the entire result.



[1] 
http://docs.oracle.com/javase/6/docs/api/java/sql/Statement.html#setFetchSize(int)
[2] http://docs.oracle.com/cd/B10500_01/java.920/a96654/resltset.htm#1023642
[3] http://jdbc.postgresql.org/documentation/83/query.html
[4] 
http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-implementation-notes.html

Reply via email to