views:

220

answers:

1

Hi,

I have a problem concerning with proxool and oracle driver in Tomcat.

The web application I use contains a webservice jar file using metro and a servlet to initialize / start the proxool pool. The proxool pool is configured with an oracle connection. When the service is called, it fetches a connection from the pool, executes a statement and returns. I close the resultset, the statement and the connection in the service method afterwards.

When I now try to hot undeploy the web application, the servlet stops proxool pool by ProxoolFacade.shutdown(); in it's destroy method.

The problem is, that the hot undeploy can not finish because the Oracle driver ojdbc5.jar can not be deleted from the folder of the extracted web application.

Trying the same with a SQL server database and the jtds driver it works without this problem.

Used versions: Apache Tomcat 6.0.18 Oracle 11g JDBC driver 11.1.0.6.0 Proxool 0.9.1

Anyone has an idea?

Regards Timo

A: 

You must add the Oracle driver to the Tomcat instance and configure Tomcat JNDI with an Oracle datasoure.

This way, the driver will stay alive when the app is terminated and Tomcat will control the pooling of the DB connections. The reason for your problem is that some DB drivers "hook" into the VM. This means that Tomcat can't unload the classes during redeploy -- there are still references around.

I'd even suggest to try to move proxool into the Tomcat server and have Tomcat manage the pools for you. That would make hot deploy much faster and more reliable, even if you leak connections.

Aaron Digulla