This is exactly what I had thought, except that it is not what seems to be
happening.  I have a bean with application scope, that is serialized by the
code in it's finalize() method.  The constructor contains only the code
necessary to read the serialized bean back to memory.  Every 24
hours(apprx.) my bean seems to be "reset", regardless of what was on the
disc, to it's original state, which renders my application useless

Paul

-----Original Message-----
From: Randy Layman [mailto:[EMAIL PROTECTED]]
Sent: 28 June 2001 12:24
To: [EMAIL PROTECTED]
Subject: RE: Tomcat and beans



        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