objects of objects, vectors and sessions

Discussion in 'Java' started by bigbinc, Nov 18, 2003.

  1. bigbinc

    bigbinc Guest

    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.
     
    bigbinc, Nov 18, 2003
    #1
    1. Advertising

  2. bigbinc wrote:

    > 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.


    --
    Regards,
    Christophe Vanfleteren
     
    Christophe Vanfleteren, Nov 18, 2003
    #2
    1. Advertising

  3. bigbinc

    bigbinc Guest

    Christophe Vanfleteren <> wrote in message news:<pOdub.29392$-ops.be>...
    > bigbinc wrote:
    >
    > > 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.



    Weep, weep, I love java.
     
    bigbinc, Nov 18, 2003
    #3
  4. bigbinc wrote:
    > 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.
     
    Michael Borgwardt, Nov 18, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ken Cox [Microsoft MVP]

    Re: Relationship between IIS Sessions and ASP.NET Sessions?

    Ken Cox [Microsoft MVP], Aug 8, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    5,421
    Luther Miller
    Aug 8, 2003
  2. Replies:
    3
    Views:
    725
    Shadowman
    Mar 26, 2008
  3. scottymo
    Replies:
    3
    Views:
    773
    Dominick Baier
    Sep 30, 2006
  4. Bookham Measures

    Moving from ASP Sessions to Database Sessions

    Bookham Measures, Jul 23, 2007, in forum: ASP General
    Replies:
    19
    Views:
    602
    Bookham Measures
    Aug 23, 2007
  5. Guest
    Replies:
    0
    Views:
    482
    Guest
    Sep 14, 2005
Loading...

Share This Page