File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Websphere and the fly likes WAS4.0 AE - Persistent session on single node Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "WAS4.0 AE - Persistent session on single node" Watch "WAS4.0 AE - Persistent session on single node" New topic

WAS4.0 AE - Persistent session on single node

Steve Granton
Ranch Hand

Joined: Jan 13, 2002
Posts: 200
I have the following scenario/problem:
I have configured persistent sessions for my application - a single app server running on a node and not in a server group. I have set the session mangement to write the session to the database after the end of every servlet service() method. I then connect to the webapp with a browser and a session is created - the SESSIONS table in the database has rows associated with the session ID that is returned. This is correct and what I expect to see. My session management (except for the persistence) has default settings
As a test I leave my browser open and stop the app server. I then restart the app server a couple of seconds after it has stopped and then click on the browser page to see the contents of my shopping cart. However, despite the fact that the session ID is the same an empty shopping cart is displayed.
Since I have set logging to Trace' in the web server plugin config file I can see that the session ID is received at the web server and sent on to WAS for processing. I can also see that it matched the CloneID that is attached to the session ID and sent it to the correct server.
My questions are:
Why was my shopping cart empty when the session was persisted to the database?
If I shutdown an application/app server rather than it failing are all sessions invalidated even if they have not timed out?
Does this single node need to be part of a Server Group in order for the app server to look in the database for the persisted session?
Thanks in advance for your help,
Matthew Comer
Ranch Hand

Joined: Aug 10, 2001
Posts: 37
Maybe a dumb question, but is the data you are attempting to save in the session serializable? If you are using a complex object graph to represent the shopping cart contents, then you need to be sure that the whole thing is serializable, otherwise it won't/can't be persisted.
Steve Granton
Ranch Hand

Joined: Jan 13, 2002
Posts: 200
Yes the objects are serializable - we've migrated the application from a clustered setup on Weblogic 6.1 and it was working fine there. Also, I wouldn't expect it to be able to write any data to the SESSIONS table in the database if the object was not serializable (there is data in there) - I would expect an exception to be thrown.
WAS seems to be having a problem when it should be retrieving the session from the database as it isn't in its memory?
Can anyone else offer a solution?
[ May 14, 2002: Message edited by: Steve Granton ]
I agree. Here's the link:
subject: WAS4.0 AE - Persistent session on single node
It's not a secret anymore!