tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Terence M. Bandoian" <>
Subject Re: Discrepancy between Tomcat's connection pool and tomcat's report on memory leaks
Date Thu, 05 Apr 2012 22:28:05 GMT
  On 1:59 PM, Pid wrote:
> If you define the DataSource in GlobalNamingResources the pool will be
> started and stopped with the Tomcat lifecycle.
> Applications have their own lifecycle inside Tomcat, they are started
> after Tomcat (obviously) and stopped before Tomcat stops (also obviously).
> This is why the pool will not stop before your application, unless you
> do something manual to change that.
> If an application causes a thread to come into existence and allowing it
> to have the WebappClassLoader as its context classloader value, but does
> not shut it down, Tomcat complains.

This is similar to the problem with JDBC 4.0 drivers.  The API docs state:

"Existing programs which currently load JDBC drivers using 
Class.forName() will continue to work without modification."

However, if you continue reading and read closely, it becomes apparent 
that drivers are automatically registered with DriverManager when a 
database connection is created.  In essence, a reference to a driver is 
implicitly created and it is the responsibility of the application to 
remove the reference.  This doesn't seem like good design to me but no 
fault to Tomcat.

-Terence Bandoian

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message