tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Terence M. Bandoian" <tere...@tmbsw.com>
Subject Re: Discrepancy between Tomcat's connection pool and tomcat's report on memory leaks
Date Fri, 06 Apr 2012 05:05:08 GMT
  On 1:59 PM, Terence M. Bandoian wrote:
>  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
>


Correction.  Drivers automatically register themselves with 
DriverManager when the driver class is loaded.

-Terence Bandoian


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


Mime
View raw message