objects of objects, vectors and sessions

B

bigbinc

Can objects of objects be stored in session variables with servlets
and are there any problems associated with this. Example can I store
a vector of vectors of vectors and the objects in the vectors are some
object. Basically will every single bit of information be stored and
then accessed without any problems. I know with object.clone() you
have to write the methods to make sure all the values are copied
properly, do we have to think the same way with session variables.
 
C

Christophe Vanfleteren

bigbinc said:
Can objects of objects be stored in session variables with servlets
and are there any problems associated with this.

Yes, but try not to store too much data in the session as that limits
scalibity (if you're clustering your webapp, the differents instances will
have to do a lot of synchronization). Even if you're not clustering, the
usual tradeoffs (speed vs. memory usage, eg putting data in a session var vs
retrieving it from a database ) are still valid.
Example can I store
a vector of vectors of vectors and the objects in the vectors are some
object.

How could the objects in a Vector not be objects ? :)
Basically will every single bit of information be stored and
then accessed without any problems.
Yes

I know with object.clone() you
have to write the methods to make sure all the values are copied
properly, do we have to think the same way with session variables.

No, if the objects in a session have to be replicated to other servers, they
are fully serialised by the server.
But you shouldn't worry about any of those things if you're not clustering
your webapp.
 
B

bigbinc

Christophe Vanfleteren said:
Yes, but try not to store too much data in the session as that limits
scalibity (if you're clustering your webapp, the differents instances will
have to do a lot of synchronization). Even if you're not clustering, the
usual tradeoffs (speed vs. memory usage, eg putting data in a session var vs
retrieving it from a database ) are still valid.


How could the objects in a Vector not be objects ? :)


No, if the objects in a session have to be replicated to other servers, they
are fully serialised by the server.
But you shouldn't worry about any of those things if you're not clustering
your webapp.


Weep, weep, I love java.
 
M

Michael Borgwardt

bigbinc said:
Can objects of objects be stored in session variables with servlets
and are there any problems associated with this. Example can I store
a vector of vectors of vectors and the objects in the vectors are some
object. Basically will every single bit of information be stored and
then accessed without any problems.

Yes.
 

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,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top