You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Craig Tataryn <cr...@hotmail.com> on 2004/02/23 16:17:34 UTC

[DBCP] - Tomcat 5

Hi, I developed a webapp using Tomcat 4.1.29 with DBCP.  The client deploy 
to Tomcat 5, and have been having connection problems.  We are running 
against Sybase Adaptive Server Anywhere, and it appears that after the 
application has been running for a while we just start getting "connection 
refused" inside or outside our application whenever we try to get a 
connection to the DB.

I was wondering, I noticed that Tomcat 5.0 ships with the DBCP jar, because 
I was developing using 4.1.29, I had to place that jar in my WEB-INF/lib.  
Would this cause a problem, is it possible my webapp is using Tomcat's DBCP 
instance to handle the connection pool, and thus when I reload my webapp, 
the previous instance of the webapp's connecitons are just being zombied?

What is the default number of connections that DBCP will try to secure?  I'm 
thinking that perhaps the pool is trying to grab more connections than we 
have licenses for.  Although you would think I would get an appropriate 
error message coming back which states that the connection limit has been 
exceeded.

In a webapp situation, how do you ensure your connection pool is destroyed 
when your webapp is recycled or stopped?

Any help/suggestions would be greatly appreciated.

Thanks,

Craig W. Tataryn

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/photos&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [DBCP] - Tomcat 5

Posted by Dirk Verbeeck <di...@pandora.be>.
Both Tomcat 4.x and 5.x ship with DBCP in common/lib so you shouldn't 
need to put them in WEB-INF/lib.

If you create your own datasource/connection pool then you should 
release the connections when the application is stopped for 
redeploying. (user the close() method)

Same if you use a context level JNDI datasource, you also need to 
close the datasource when your application gets reloaded. (using a 
listener)

If you use a global JNDI datasource then this isn't needed of course.

The default number of connections is 8 (maxActive)
http://jakarta.apache.org/commons/dbcp/configuration.html

-- Dirk

Craig Tataryn wrote:

> Hi, I developed a webapp using Tomcat 4.1.29 with DBCP.  The client 
> deploy to Tomcat 5, and have been having connection problems.  We are 
> running against Sybase Adaptive Server Anywhere, and it appears that 
> after the application has been running for a while we just start getting 
> "connection refused" inside or outside our application whenever we try 
> to get a connection to the DB.
> 
> I was wondering, I noticed that Tomcat 5.0 ships with the DBCP jar, 
> because I was developing using 4.1.29, I had to place that jar in my 
> WEB-INF/lib.  Would this cause a problem, is it possible my webapp is 
> using Tomcat's DBCP instance to handle the connection pool, and thus 
> when I reload my webapp, the previous instance of the webapp's 
> connecitons are just being zombied?
> 
> What is the default number of connections that DBCP will try to secure?  
> I'm thinking that perhaps the pool is trying to grab more connections 
> than we have licenses for.  Although you would think I would get an 
> appropriate error message coming back which states that the connection 
> limit has been exceeded.
> 
> In a webapp situation, how do you ensure your connection pool is 
> destroyed when your webapp is recycled or stopped?
> 
> Any help/suggestions would be greatly appreciated.
> 
> Thanks,
> 
> Craig W. Tataryn
> 
> _________________________________________________________________
> Add photos to your e-mail with MSN 8. Get 2 months FREE*.  
> http://join.msn.com/?page=features/photos&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org