Hi Andrea,
Maybe I am missing some knowledge about JDBCDatastores and connection pools.
How can I share a connection pool between 2 different datastores?
As far as I know a connection pool is part of a datastore and always separate.
In other words if i create two datastores then two connection pools are created.
This is what I do:
java.util.Map params = new java.util.HashMap();
params.put("dbtype", "oracle");
params.put("user", USER);
params.put("passwd", PASSWORD);
params.put("max connections", 50);
params.put("min connections", 10);
params.put("connection timeout", 5);
params.put("validating connections", false);
params.put( "host", HOST);
params.put( "port", PORT);
params.put( "database", SERVICE_NAME);
datastore = new
OracleNGDataStoreFactory().createDataStore(params);
The value of "min connections" does not have any effect on the number of
started Oracle database sessions.
Do you agree that it would be better that "database schema" is part of Query
object instead of Datastore object?
Thanks.
Ron
On Wednesday, December 18, 2013 3:08 PM, Andrea Aime
<andrea.a...@geo-solutions.it> wrote:
On Wed, Dec 18, 2013 at 2:58 PM, Ron Lindhoudt <rlindho...@yahoo.com> wrote:
Hi all,
>
>
>It is advised to cache the (Oracle) JDBCDatastore because it is a heavy
>object. I experienced this as well because it searches for a lot of metadata
>during feature layer queries that are executed during StreamingRenderer.paint()
>
>
>So now I am trying to cache it in a servlet and reuse it for all sessions.
>As far as I know it is thread-safe to use in this way.
>The questions that I have:
>- I use data from multiple database schema's. So I have to use
>setDatabaseSchema() for the datastore. But if I do that for one session, other
>sessions may have problems with that if they have to query data from other
>database schema's. So this is probably not thread-safe. I probably need to
>cache datastores for each database schema, correct?
>I nicer way would be that database schema is not part of a datastore but part
>of the feature layer query.
I'd suggest to keep one cached store per schema then, and have them share the
same connection pool
>
>- If i set "min connections" of the datastore properties to a value larger
>than 1 there is still only one real Oracle database session active.
>What is the use of " min connections"?
It configures the DBCP connection pool to keep at least one connection always
open.
Not sure why you're getting less than min though? We are either misconfiguring
it, or it's an issue with the DBCP library.
Cheers
Andrea
--
== GeoSolutions will be closed for seasonal holidays from 23/12/2013 to
06/01/2014 ==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users