How do you deal with concurrency in a webapps HttpSessions?
The servlet spec specifically mandates that implementations should allow multiple concurrent request threads to pass through an HttpSession. It omits describing any synchronisation protocol around the HttpSession that the container and application might use in order to coordinate their activities. This has presented a problem for a number of Manager implementations that I have looked at. Many chose simply to ignore the problem. This problem becomes far more pressing as the number of activities that the Manager may wish to perform on an active HttpSession increases in frequency or complexity. WADI, for instance, needs to be able to guarantee that no application threads are altering an HttpSession’s content whilst the Manager is trying to serialise the HttpSession as part of a relocation (migration) to long term store or another node. Synchronising around the HttpSession would not actually solve our problem. If we wish to relocate an HttpSession to another node, we must prevent, once we