views:

169

answers:

2

My Java (non-Web) application may have to create Connection Pools of about 200 different Datasources. Yes, all 200 of them connecting to different Databases. Not 200 connections in the pool.

Here are some questions that are bugging me..

1) Should I anticipate major (performance etc. issues?

2) Are there any Non-commercial Java tools available out there which can be useful.

3) I tried to search the web but did not really find a straight answer. Does anyone have a link to some good resource on the web in this regard?

Thanks in Advance

A: 

do you neeed to access all data sources at the same time? if not, i would use the connections directly, without pooling when there is demand for one of them, or alternatively configure the connection pool conservatively with 0 as the min-open connections. the only resource i would worry about are open sockets. if you keep a great number of open sockets, you may run into OS limitations or even TCP limitations. note that some versions of windows limit the number of new tcp sockets per second that can be established. so startup of the application may become slow or in extreme cases when running your app on windows 98 establishing tons of connections simultanously may fail. after all i would not really worry about having 200 datasources, unless they get in the thousands.

Andreas Petersson
+1  A: 

If you are writing a desktop / console application You could use Commons DBCP to manage your Datasources and Connection pools. You could add Spring to the mix here to help manage the configuration of your datasources.

If you are writing a webapp. You can use your servlet container to setup and manage the datasources (retrieve them via JNDI).

Your question is pretty vague. I still don't understand the context in which you need all these datasources.

My guess is you need a few datasources with a large number of connections in the pool.

ScArcher2