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 object, loading
> the results in memory and closing the resultset and connection right
> away?
Just a note on the intend: one assumption behind AuthorityCodes was that it
would have two typical usages:
* Get the AuthorityCode set and iterate over all the ID.
This usage can be well handled by the above proposal.
* Just want to check if an ID exists, with:
factory.getAuthorityCodes().contains(theID);
In the later case, gathering all ID is a more extensive work than needed. My
attempt behind AuthorityCodes was to map "Set.contains(...)" to a simple
"SELECT
name FROM ... WHERE ID=?" in order to take advantage of database index without
loading any of the 3000+ ID. This is a PreparedStatement that current
AuthorityCodes keep as long as it is alive, it order to allow efficient
execution of Set.containsAll(...) for example.
Martin
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel