On 2017-12-12 23:58, Andy Seaborne wrote:
> 
> 
> On 12/12/17 22:54, George News wrote:
>>>> I'm planning on changing the class/methods call hierarchy in order to
>>>> use transactions only on the upper levels, so this way I will be only
>>>> opening one transaction and handle everything within it. The problem is
>>>> that this is a major change, and will remove the autonomy from each
>>>> class, but if this is the price to make the code stable I will have to
>>>> do so.
>>> Txn and explicit control will bite you.
>> Then from your comment above, and this one (which I hope code doesn't
>> bite ;)) I will be changing the code to remove references to begin/end
>> and try to use Txn as much as possible.
>>
>> However, I cannot do for every part of the code, as the ResultSet is
>> handle in different functions (one begin() transaction, another
>> presents/adapts results and end transaction()). The main problem is that
>> this transaction is the outer one.
> 
> try(QueryExecution qExec = ...) {
>    ResultSet rs = ResultSetFactory.copyResults(qExec.exexSelect());
>    return rs;
> }
> 
> Once copied, the result set is not dependent dataset and so not
> dependent on the transaction.

I know that, but some of the resultsets are 10Mb-50Mb or more in size,
and I don't know what is the impact in performance in case many request
arrives at the system.

Currently I'm directly streaming the ResultSet using StreamingOuput. I
convert each row in the Accept format and sent it. This way I don't have
anything in memory.

But, just one question concerning copyResults and keeping the original
resultset. Is the original ResultSet data kept in cache? I mean the
whole lot of results, or just one.

>     Andy
> 

Reply via email to