Il giorno mer, 11/10/2006 alle 16.02 +0200, DE VINZELLES, Guillaume
(ext.) ha scritto:
> Hello there,
> 
> We are running a Tomcat 5.5.17 on a Sun Solaris system (SunFire V240) with a 
> Sun JVM 1.5, and we are facing unavoidable JDBC pool exhaustions. We are 
> using an Oracle 9i database.
> 
> Here is the JDBC entry from our server.xml:
> 
> <Resource name="jdbc/Signup" auth="Container" type="javax.sql.DataSource"
> driverClassName="oracle.jdbc.driver.OracleDriver" 
> url="jdbc:oracle:thin:@address:port:schema" 
> username="user" password="pass" maxActive="120" maxIdle="10" maxWait="5000" 
> removeAbandoned="true" removeAbandonedTimeout="60" />
> 
> The Tomcat manager shows around 1000 sessions on the server, which seems to 
> be pertinent.
> 
> We can see with the JMXProxy that the JDBC pool connections are never 
> recycled, e.g. the active connections number is going higher and higher and 
> never stays at the same level, which is strange because the amount of active 
> sessions isn't growing.
> 

From my understanding of the DBCP docs I see that the removeAbandoned
mechanism is triggered only when numIdle < 2 && ( numActive > maxActive
- 3 ). So I think that if some application code doesn't release a
connection you *could* see the numActive grow until maxActive but you
*shouldn't* have a pool exahustion (that force you to manually close()
the connection pool or restart Tomcat) because when you reach the limit
the pool will check if some active connection is eligible for removal.

But I'm not sure of this... the docs are not so clear...

Recently I've experienced a pool exhaustion problem with Oracle JDBC
thin driver 10.2.0.1.0. The problem arised when for some unexpected
network problem all idle connections was resetted. At the time I made a
getConnection() the (unusable) connection became active and then... no
more released by the pool (still the application throwed an Exception
and returned, cleaning up in finally blocks).

I solved using the validationQuery and testOnBorrow=true options of
DBCP.

> Do you have any idea about what we can do to 'force' the Tomcat server to 
> release the unused JDBC connections?

Via JMX you can do a close() on the pool that will close all active and
idle connections.

Ciao,
Davide Romanini

Attachment: signature.asc
Description: Questa รจ una parte del messaggio firmata digitalmente

Reply via email to