Sure you can make it transient, but then your not saving the state of the object in question. Your just skipping over it. The problem arises when you want to serialize and save the state of an oject that you don't have the src code to, say a JDBCConnection or any of the JAVA Collection classes that are not serializable. With a serializableAdapter you have a mechanism to make them serializable, by holding them in an Adapter class and then
providing implementations of the read|writeObject methods, if I recall correctly. The article at www.javageeks.com covers it in more detail.

Sean Kroah

Alef Arendsen wrote:

can't you make any object that you cannot make serializable just TRANSIENT so it won't cause any problems??? alef
----- Original Message -----
Sent: Tuesday, January 02, 2001 22:06
Subject: Re: Session Object Serailization
 I believe the servlet 2.2 spec requires that everything that is put into the session is serializable. If that's true I doubt that every servlet engine will require that. If they do then you'll need to make all of the objects that you
put into the session serializable which could be a real pain and even impossible in some cases. You can't make your jdbc connection serializable for instance.  There is an article at www.javageeks.com that shows one way to address this via a SerializableAdapter for your non serializable objects.

It'd be cool if one of the tomcat guys could talk about whether, in the future,  they will require all objects in a session to be serializable. Maybe it's been discussed to death already...

Sean Kroah

Shahed Ali wrote:

 Hi, Does tomcat seralize session objects ? 1. If it does, and I have non serializable objects like SQL Connections sitting in  my session, then    what should I do ? 2. If it does not, and I have a lot of sessions lying around, then will tomcat crash due to memory limitations ? ThanksShahed
-- 
Sean Kroah                                T:503.222.9660
                                          F:503.241.5682
WireX Communications, Inc. 
Software Engineer,                        [EMAIL PROTECTED]
 

-- 
Sean Kroah                                T:503.222.9660
                                          F:503.241.5682
WireX Communications, Inc. 
Software Engineer,                        [EMAIL PROTECTED]
 

Reply via email to