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 to work through the Jody Garnett wrote: > 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 "Object sample = > authorityCodes.iterator().next()"; > > Letting these AuthorityCodes sets escape out into the wild world of > user code would prove fatal for me - since the connection could be > reclaimed at any time (indeed I suspect that they would break in the > existing implementation when the connection is reclaimed at the twenty > minuet mark?). > > Regardless I need to figure out how I can be greedy - and aquire all > the authority codes on set creation :-( > I have two ideas: > - just do it - slurp up the codes on creation and pay the price of > doing my query right away > - half implement - do a quick query to a set of the keys referenced, > and then be willing to look up the keys (using full createObject calls > - one at a time as iterator() is called :-( > > This is really scary since this kind of thing is used to handle "all" > the codes in the EPSG database... > I am going to stuggle for a little bit longer on this one. > > Cheers, > Jody ------------------------------------------------------------------------- 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
