You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rhonny David <rh...@yahoo.com> on 2011/02/01 07:32:20 UTC

how to refresh connection pool before it gets completely busy

Dear All,

We are facing connection pool busy problem in tomcat 6.0.29. Till we finalize 
our investigation, we need connection pool to be refreshed before all 
connections get busy. Say for example if we have connection pool size 60, then 
it should get refresh when 15 connections get busy. We know that we cannot 
define connection pool should refresh after X connections get busy but we can at 
least define the timeout for an abandoned connections. We have tried this using 
the removeAbandonedTimeout property, but still its behaviour is that it 
refreshes the pool when all connections get busy. Following is the entry of our 
context.xml file:


<Resource factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" 
auth="Application" removeAbandoned="true" logAbandoned="true" 
removeAbandonedTimeout="120" validationQuery="select 1" 
driverClassName="net.sourceforge.jtds.jdbc.Driver" maxActive="60" maxIdle="20" 
maxWait="10000" name="DB_Pool" type="javax.sql.DataSource"  
url="jdbc:jtds:sqlserver://10.22.4.30/XYZ" />


Can anyone help how we can achieve this , that connection pool refreshes before 
all connections get busy?

Regards,
David


      

Re: how to refresh connection pool before it gets completely busy

Posted by Ognjen Blagojevic <og...@gmail.com>.
Hi Rhonny,

> Can anyone help how we can achieve this , that connection pool refreshes before
> all connections get busy?

You might want to check jdbc-pool, which sovles some of the problems 
with dbcp:

   http://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html

Regards,
Ognjen

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: how to refresh connection pool before it gets completely busy

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/2/1 Rhonny David <rh...@yahoo.com>:
> <Resource factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"

Tomcat does not implement those connection pools per se, but borrows
implementation from the Commons Pool and Commons DBCP components of
Apache Commons. It renames the packages at build time, to avoid
conflict if the same classes are directly used by deployed webapps.

You can look into build.properties.default file in the sources of
Tomcat version that you are using to see what versions of those
components were used at build time.

If you need custom behaviour, your best bet is to extend those classes
and use them instead of Tomcat-provided ones.


If you have questions it is best to ask on their mailing list,
http://commons.apache.org/dbcp/mail-lists.html

http://commons.apache.org/dbcp/configuration.html


Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org