Jody Garnett a écrit :
> This is an amazing example of being lazy - the Set is returned - and
> each call to iterator() will produce a result set ... (no word on
> leaking results set when normal people call "Object sample =
> authorityCodes.iterator().next()";
We rely on finalize() for closing
Andrea Aime a écrit :
>> This is an amazing example of being lazy - the Set is returned - and
>> each call to iterator() will produce a result set ...
>
> (...snip...)
>
> how about a compromise: you gather all of the ids, keep a reference
> to the DataSource, and then issue a query every 100 ob
Jody Garnett ha scritto:
> Hi Martin - I found another fun bit of code today (as I try to unplug
> connection from daily use...): AuthorityCodes
>
> This is an amazing example of being lazy - the Set is returned - and
> each call to iterator() will produce a result set ... (no word on
> leaking
I came up with one good alternative to being greedy - let AuthorityCodes
function as it does now - but force it to use a DataSource and aquire
its connection as needed.
I am going to stick with being greedy and caching the result; it will
work out better in the concurrent case.
Jody
Find seems
Hi Martin - I found another fun bit of code today (as I try to unplug
connection from daily use...): AuthorityCodes
This is an amazing example of being lazy - the Set is returned - and
each call to iterator() will produce a result set ... (no word on
leaking results set when normal people call