tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Whitlock" <>
Subject RE: Serialized Java Beans.
Date Thu, 30 Oct 2003 17:09:38 GMT
	You can't serialize a class if it doesn't implement the
Serializable Interface.

-----Original Message-----
From: Andoni [] 
Sent: Thursday, October 30, 2003 10:17 AM
To: Tomcat Users List
Subject: Re: Serialized Java Beans.

My JavaBeans are being stored in session even though they don't

What am I missing?  Should I add it?


----- Original Message -----
From: "Shapira, Yoav" <>
To: "Tomcat Users List" <>
Sent: Wednesday, October 29, 2003 5:19 PM
Subject: RE: Serialized Java Beans.

It's good practice to make beans that you put in a session Serializable.
Tomcat indeed serializes sessions by default, and if you put a
non-Serializable bean in the session you'll get a runtime exception.

However, tomcat doesn't due this to free memory under load as much as it
does it to persist sessions across server restarts.

Yoav Shapira
Millennium ChemInformatics

>-----Original Message-----
>From: Andoni []
>Sent: Wednesday, October 29, 2003 10:10 AM
>To: Tomcat Users List
>Subject: Serialized Java Beans.
>I recently read that if a JavaBean implements Serializable the servlet
>engine can write it to disk if it is not being used and if it's
>decides this would be a good idea.
>Can anybody tell me if Tomcat does this?  Should I be sure to always
>implement Serializable in JavaBeans that I am storing in session?
>The actual quote from the book is:
>Occasionally some servers may choose to write these attributes to disk
>free memory.  To take advantage of this functionality, it is a good
idea to
>ensure that any objects placed inside a session implement the
> interface so that the object may be written to a
>stream. In a similar manner, applications that execute inside a
>environment may have their entire sessions and session attributes
>passivated and reactivated on a different machine.  If our application
>marked as distributable then it is important that any session
>are Serializable to support this.
>Wrox: Professional SCWCD Certification: ISBN 1-86100-770-1

This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential,
and/or privileged.  This e-mail is intended only for the individual(s)
whom it is addressed, and may not be saved, copied, printed, disclosed
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.

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

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

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

View raw message