posted 22 years ago
The short answer is "yes".
Beware of making assumptions about the number of JVMs though. Both the web and the EJB tier may be distributed, which means that there are multiple JVMs (and probably multiple hosts) that behave, to a certain extent, as if they were one big container.
For instance, a distributed web container will typically share sessions between all its copies. In the most sophisticated implementations, any copy can at all times handle requests from any client because the same session data is available everywhere. IBM's Websphere, for example, can share sessions by persisting them in a database.
Compare this with the approach using multiple independent containers, where the load balancer has to support sticky sessions to make sure that all requests in a browser session are handled by one and the same server. This is necessary because the other containers, being independent, do not know about that browser's session state at all.
The approach you use is determined by the scalability requirements (independent containers scale best), the uptime requirements (a fully distributed container can provide transparent fail-over if a machine crashes) and the programming effort involved (a single, non-distributed server on a fat multi-CPU box saves you an awful lot of headache).
- Peter
[ March 11, 2002: Message edited by: Peter den Haan ]
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd