Re: [Geotools-devel] Learning about being greedy

2007-06-29 Thread Martin Desruisseaux
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

Re: [Geotools-devel] Learning about being greedy

2007-06-29 Thread Martin Desruisseaux
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

Re: [Geotools-devel] Learning about being greedy

2007-06-28 Thread Andrea Aime
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

Re: [Geotools-devel] Learning about being greedy

2007-06-28 Thread Jody Garnett
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

[Geotools-devel] Learning about being greedy

2007-06-28 Thread Jody Garnett
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