This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi, 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, Steve
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. Matt
Joined: Jan 13, 2002
Hi, 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? Cheers, Steve [ May 14, 2002: Message edited by: Steve Granton ]