Need for Serializable Object in request?

J

James Yong

Hi,

I know that we need to make the object serializable before putting them in a
Session for web environment.
Do we need to do the same if we are putting the object in a Request?

Regards,
James
 
T

Thomas Hawtin

James said:
I know that we need to make the object serializable before putting them in a
Session for web environment.

Only necessary for distributable web apps.
Do we need to do the same if we are putting the object in a Request?

No. A request is always processed on a single server, so there is no
need to transfer the objects.

Tom Hawtin
 
J

James Yong

Thomas Hawtin said:
Only necessary for distributable web apps.
Do you mean distributed web apps?

Hi Thomas,

My understanding for making objects, that stores in Session, serializable is
because Tomcat may need to deserialize the objects into the hard disk
whenever there isn't enough memory to hold them.

No. A request is always processed on a single server, so there is no
need to transfer the objects.

Tom Hawtin

Ok, thanks for your clarification. (",)

Regards,
james
 
J

John C. Bollinger

Thomas said:
Only necessary for distributable web apps.

A prominent (and documented, SRV.7.7.2 in Servlet 2.4) consideration for
distributable web apps, but not a negligible one for any web app. Even
a non-distributable web app's sessions may sometimes be serialized. I
have specifically seen it happen in warm redeployment / warm restart
scenarios, where serialization was used to attempt to avoid terminating
live sessions (at least I think that was the goal). This was a
container behavior, not a webapp-specific one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top