permaculture playing cards*
The moose likes Servlets and the fly likes Do servlet servers sill have trouble with sessions? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Do servlet servers sill have trouble with sessions?" Watch "Do servlet servers sill have trouble with sessions?" New topic
Author

Do servlet servers sill have trouble with sessions?

paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20540
    ∞

Many moons ago I worked on a servlet intensive project using JRun. After a lot of frustration we discovered that the JRun servlet session stuff had some serious problems and we had to handle sessions manually.
Later, I found out that the new JRun stuff had not fixed the problem. Then, talking to some engineers using other J2EE servers, discovered that this is a very common problem.
Now I'm about to get hip deep in a new project that will require sessions. Should I roll my own or should I trust the built in stuff?


permaculture Wood Burning Stoves 2.0 - 4-DVD set
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
    
    6
I can't say that I've had any problems with sessions in the last couple of years to be honest. Perhaps with the early Tomcat and WebLogic releases but nothing recently.
Simon
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
We run JRun 3.1 with no noticable problem with sessions. You do have to be sure all of the objects in the session are serializable.
Bill
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
No other Server that I know of has any problems with sessions, even when clustered. There's just two rules to live by:
(1) Make everything in them serializable (and use transient fields for things that aren't).
(2) If you're using clustering, keep the sessions relatively small in total size (<16K each) for performance reasons.
Kyle


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
k Oyedeji
Ranch Hand

Joined: Jul 07, 2002
Posts: 96
Paul
Can you remember any specifics at to what the issues were?
Thanks
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20540
    ∞

I remember that we had an applet that needed access to the session. Since the applet was treated by the server as a seperate session, we would get the browser session ID and pass it to the applet. The applet would pass that to the server when it needed information and the session would be pulled up by ID. Sometimes passing in the right ID gave you back somebody else's session.
It seems there were some other problems that I cannot remember.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
What you describe might have been caused by sloppy coding using servlet instance variables or otherwise mixing up objects outside the session mechanism.
Bill
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20540
    ∞

I know that in the end it turned out to be bugs within JRun. When bringing the issue up with other engineers over the year or two afterward, I came to the conclusion that it was a common problem and many folks had ended up rolling their own session management (not always a light task).
DC Dalton
Ranch Hand

Joined: May 28, 2001
Posts: 287
I run 5 different sites that rely heavily on sessions & have NEVER had a problem with them. I use Linux, Cobal & Webppliance servers, Tomcat & Resin servlet engines.... I even have one that dumps hundreds of rows from a db into an object, then session so the cust so go thru one record at a time approving them.....never even blinks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Do servlet servers sill have trouble with sessions?