I'm running Tomcat 5.5.12 on Mac OS X and have recently switched from using a Hibernate-configured DBCP to using a JNDI-configured/owned c3p0 pool. I recognize that this may not necessarily be the correct place to ask this question, since the problem may be with c3p0, but perhaps other users may recognize these problems because c3p0 is commonly used with Tomcat.

The problem I have is that when I redeploy my application, which itself contains the c3p0 pool <Resource/> in a META-INF/context.xml file, I eventually reach a point -- after 2 or 3 deploys -- where my database (PostgreSQL, as it happens) complains about too many clients connecting.

I am confident that Hibernate is not involved because the problems begin on redeployment, when the pool tries to acquire and validate JDBC connections, before Hibernate is given a connection.

Could this perhaps be a failure of Tomcat to un-initialize the pool on undeployment (which I perform in my build file using Tomcat's Ant tasks, prior to deployment of the new WAR file)? Or perhaps it is a failure of c3p0 to release resources when Tomcat asks it to?

I liked that my deployment cycle didn't have to involve restarting Tomcat, and I think I can probably solve this by putting the c3p0 configuration in <GlobalNamingResources/> in server.xml, but I really like that my WAR file is totally self-contained right now. It deploys fine the first time, but subsequent deployments (second or third time) produce the problem I have outlined here.

Can anyone offer suggestions, or share experiences that could illuminate a path forward?

Thanks very much.

David

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to