Hello Jody

Jody Garnett a écrit :
> I had a good chat with my customer on this one; out of that list of
> specific problems I placed on the wiki they are only really concerned
> about three of them...
> 1. Connection leaks

This one may be easy to fix. In FactoryOnOracle constructor, we may invoke

setTimeout(30000); // Close connection after 30 seconds of inactivity.

http://javadoc.geotools.fr/snapshot/org/geotools/referencing/factory/DeferredAuthorityFactory.html#setTimeout(long)

If we don't invokes setTimeout explicitly, the current default in 20 minutes if
I remember correctly.

Note: instead of invoking setTimeout in FactoryOnOracle, we may want a more
general solution. Should we use a lower default value for every EPSG factories
(not just on Oracle)? Or is there any way to detect that a pool of connection is
in use so we can set automatically a low default timeout in such case?


> 2. Concurrency

This one is more difficult. We probably want to keep a single
BufferedAuthorityFactory instance (otherwise CRS already created could be
created again by an other buffer). So we would want BufferedAuthorityFactory to
manage many FactoryUsingSQL instances.

May be better to revisit that after we will be allowed to compile for Java 5, so
we can take advantage of java.util.concurrency.



> 3. Removing our own DataSource extension - it looks like we have that
> one in order (I am using a normal OracleDataSource in my testing)

Yes; they still there only for respecting the "deprecate, then delete" cycle.


> I have several crazy ideas here ...
> - Arranging a in memory cache of produced objects, fed by a pool of
> Factories (as long as the pool of factories is smaller in number then
> the DataSource pool size). This would let each Factory not be a bottle
> neck when faced with thousands of users...

BufferedAuthorityFactory's job is to cache objects produces by an other factory.

AllAuthorityFactory's job is to delegates object creation to a pool of other
factories, instead of only a single one.

So new BufferedAuthorityFactory(new AllAuthorityFactory(...)) should do the
suggested memory cache if I'm understanding correctly...
org.geotools.referencing.DefaultFactory is doing exactly that.


> - Using a Semaphore lock (counting readers) so a Factory can hold onto a
> connection if a second thread had already come in wanting to create an
> artifact)
> - Probably break out a strategy object for the "connection handling" so
> we can try a several different locking approaches (including the current
> time out)

Yes we can try stuff like that. But again I wonder if we should wait for Java 5?
I think that it will not be trivial to implement...

        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
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to