tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dale Ogilvie" <Dale_Ogil...@trimble.com>
Subject How to close all connections in a Tomcat container db connection pool?
Date Tue, 10 May 2011 23:24:17 GMT
Hi,

We just had an issue in production on tomcat 6, a web application was
getting strange errors from the oracle database:

java.sql.SQLException: ORA-06508: PL/SQL: could not find program unit
being called in Package

Our configuration uses a database pool in GlobalNamingResources of
server.xml

  <!-- Global JNDI resources
       Documentation at /docs/jndi-resources-howto.html
  -->
  <GlobalNamingResources>
    <Resource accessToUnderlyingConnectionAllowed="true"
auth="Container" driverClassName="oracle.jdbc.OracleDriver"
maxActive="10" maxIdle="5" maxWait="10000" name="jdbc/oraclePool"
password="xxx" type="javax.sql.DataSource"
url="jdbc:oracle:thin:@db.acme.com:1521:ACME" username="java_pool"
validationQuery="select 1 from dual"/>
  </GlobalNamingResources>

The cause of the error was the db admin patching a db package underlying
one used by our web-app. Post patch all the packages appeared valid to
the admin, but not to our app using db connections established prior to
the db patching.

We redeployed our app, but the error persisted. The only way to remove
the db error was to restart tomcat. Possibly, there was something wrong
with the database connections in the pool, not reflecting the new state
of the database.

Is there any way to tell the running Tomcat to clean out the connection
pool, so that it throws away all the established connections, and
establishes new ones for the applications. I don't really want to have
to stop all the applications on our server to deal with this sort of
issue.

Thanks

Dale

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


Mime
View raw message