|
Re: bug in JGStore: msg#00048java.jetty.general
Davide Rossi wrote: So that you can add it to your own list. Yes, This is a big problem with HttpSession replication. It boils down to the fact that HttpSessions were initially designed as local objects, then had remote semantics grafted on to them with the addition of <distributable/> webapps. You have three choices when trying to resolve this: 1). always replicate the whole session - you cannot know whether its contents have changed, so assume the worst case scenario - very expensive. 2). make a contract with the application that if they change an attributes value, they will call call session.setAttribute() and only replicate when you know the session is dirty - much more efficient, but does not handle change by reference - your problem. 3). use aspects/byte-code-engineering in some way to alter the app-space objects held in the session so that they will notify you upon change. Then you will know when the session is dirty and what to replicate. - would be highly efficient, but I don't see how it can be done and have yet to find anyone who has done it successfully. Of course, you can use various levels of checks and caching to mitigate the effect of the above, but I think these are the basic solutions to the problem. wadi.codehaus.org, my latest attempt to perfect the art of bomb-proof HttpSessions will provide both (1) and (2). The Jetty distributable session manager only provides (2). The best workaround for you is probably just to call s.setAttribute("X", s.getAttribute("X")) every time you know you have changed a session attribute value. This may add to the complexity of your code, but will give you a working solution. Does that help ? cheers, Jules -- /********************************** * Jules Gosnell * Partner * Core Developers Network (Europe) * * www.coredevelopers.net * * Open Source Training & Support. **********************************/ ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: War files: packed or unpacked?, DE BENEDICTIS DAVIDE |
|---|---|
| Next by Date: | Re: bug in JGStore, Jules Gosnell |
| Previous by Thread: | War files: packed or unpacked?, DE BENEDICTIS DAVIDE |
| Next by Thread: | Re: bug in JGStore, Jules Gosnell |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |