If you create a bean with an application scope, it will stay there
until you remove it.  Once you have removed the bean from the application
scope, it is eligible for Garbage collection by Java.  Tomcat is not
involved in calling finalizers.

        Tomcat also never serializes beans.  It only works with them in
memory and never transfers them between processes.  The spec requires
serialization because other Servlet containers do this type of transferring.

        Randy

> -----Original Message-----
> From: Paul Hunnisett [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 28, 2001 4:48 AM
> To: [EMAIL PROTECTED]
> Subject: Tomcat and beans
> 
> 
> How does Tomcat manage standard Java beans?  I have attempted 
> to use an
> application scoped bean ands have included serialization code in the
> finalize() method and the code to read up from file in the 
> constructor.  I
> assumed that whenever Tomcat thought a bean was unnecesary it 
> would simply
> garbage collect it(which would call my finalize() method) but 
> this doesn't
> seem to happen.  The bean get's created fine, but not 
> serialized properly.
> What is Tomcat doing?
> 
> Paul Hunnisett
> 

Reply via email to