Hello,

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 algorithm 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 to free memory. 
 To take advantage of this functionality, it is a good idea to ensure that any objects 
placed inside a session implement the java.io.Serializable interface so that the 
object may be written to a stream. In a similar manner, applications that execute 
inside a distributed environment may have their entire sessions and session attributes 
passivated and reactivated on a different machine.  If our application is marked as 
distributable then it is important that any session attributes are Serializable to 
support this.

Wrox: Professional SCWCD Certification: ISBN 1-86100-770-1


Thanks,

Andoni.

Reply via email to