I was wondering if Echo webapps are distributable in the J2EE sense ? If the webapp is running on a J2EE cluster, and it gets swapped-out from one node and moved to another node, will it still work?
I was wondering if Echo webapps are distributable in the J2EE sense ? If the webapp is running on a J2EE cluster, and it gets swapped-out from one node and moved to another node, will it still work?
-- Dan
[snapback]2773[/snapback]
Since in the J2EE sense Echo is just a Servlet, I believe the answer is yes, assuming that Servlets are clusterable (I'm pretty new to J2EE, but I think this assumption isn't a stretch).
"The programming requirements for a distributable servlet are much stricter than the requirements for a nondistributable servlet. A distributable servlet must be written following certain rules so that different instances of the servlet can execute on multiple backend machines. Any programmer assumptions that there's only one servlet instance, one servlet context, one JVM, or one filesystem have the potential to cause serious problems."
You also need to be more careful with what you save in the HttpSession (since the session could be moved to another node -- that is, it could be serialized on one machine and de-serialized on another machine)
morris+Feb 21 2005, 07:15 PM(morris @ Feb 21 2005, 07:15 PM)
Since in the J2EE sense Echo is just a Servlet, I believe the answer is yes, assuming that Servlets are clusterable (I'm pretty new to J2EE, but I think this assumption isn't a stretch).
Not quite. See this article for example:
"The programming requirements for a distributable servlet are much stricter than the requirements for a nondistributable servlet. A distributable servlet must be written following certain rules so that different instances of the servlet can execute on multiple backend machines. Any programmer assumptions that there's only one servlet instance, one servlet context, one JVM, or one filesystem have the potential to cause serious problems."
You also need to be more careful with what you save in the HttpSession (since the session could be moved to another node -- that is, it could be serialized on one machine and de-serialized on another machine)