Results 1 to 5 of 5

Thread: Managing objects being held in session

  1. #1
    Join Date
    Aug 2004
    Posts
    10

    Default Managing objects being held in session

    I want to know if someone could recommend "rules of thumb" when deciding whether to keep or not objects in servlet session between different requests

    Alternatives, PROS and CONS, etc

    Thank you
    Diego Dagum
    Self-confidence, Chile

  2. #2

    Default

    I personally try to put as few stuff as possible in the session. The main reasons are from a user perspective. I would rather be able to bookmark pages & send links that directly open a specifc page, and if I fork a session (Open link in a new page/tab), then I don't want changes in one page/tab mess with the other one.

  3. #3

    Default

    I forgot too, putting stuff in the session scope might create issue when using back too. Also, to avoid problems with back button and refresh, I use GETs anytime an operation doesn't modify the database, and when I use POST, I never display directly a page, I always use a redirect to a GET.

  4. #4
    Join Date
    Aug 2004
    Posts
    10

    Default

    Thanks a lot, champ.

    I want to know alternative mechanisms for session holding avoidance

    For instance, a friend of me sends data back and force between web server and client browser

    I dont like it too much because we are adding complexity on pages (remember that web means hypertext, so you have to drag use case-related info in the whole presentation layer)

    Another one is persists some data in a cache (memory -similar to keep in session and maybe problematic on clusters- or secondary storage)

    Even, to store use case related info on database



    I want to know if someone could tell personal experiences approaching this problem
    Diego Dagum
    Self-confidence, Chile

  5. #5

    Default

    I'm not sure I really understand your question, but when I want information to be passed from one request to another I add the minimum needed to every link (i.e. IDs), so that I can retrieve the data before handling the request, with the data possibly cached somewhere.

    Concerning when to put stuff in the HttpSession, I usually only do that when the data is user specific. For example, items in a shopping cart are user specific, while a search result could be meaningful for anyone.

    Not quite sure my answer is useful, since I'm unsure what kind of answer you were looking for, but I hope it helps.

    Guillaume

Similar Threads

  1. OpenSessionInView and portlet support
    By garpinc2 in forum Web Flow
    Replies: 31
    Last Post: Apr 9th, 2010, 11:12 AM
  2. OpenSessionInView + CMT Session usage
    By alesj in forum Data
    Replies: 7
    Last Post: Aug 16th, 2005, 02:32 AM
  3. Replies: 3
    Last Post: May 16th, 2005, 07:04 AM
  4. Replies: 1
    Last Post: Mar 12th, 2005, 04:33 AM
  5. Replies: 3
    Last Post: Nov 19th, 2004, 07:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •