Often times developers will put objects in session and modify them without calling javax.servlet.http.HttpSession.setAttribute(String, Object) or javax.servlet.http.HttpSession.removeAttribute(String).
This is BAD because if session persistence is enabled the session manager does not know that the session is touched and fails to replicate to the persistence store. This persistence store can be another server, a database, a data grid or an appliance.
To solve this problem I have written a servlet that forces a sync and writes out all the session attributes to the persistence store at the end of the servlet request.
Take a look and download the src here ..
If you will also need to add the following filter.xml to your web.xml sorry not everyone is on servlet 3.0 :-)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.