tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chad Johnson <ch...@netnet.net>
Subject RE: Sessions across contexts, is it possible?
Date Sat, 12 Jan 2002 05:42:57 GMT
Great, thanks for the insight.  The persistance layer sounds most
pleasing.

-Chad


On Fri, 11 Jan 2002, Craig R. McClanahan wrote:

> No, virtual hosts are considered (by the servlet API) to be totally
> independent.
> 
> If you want to delve into container-specific behavior, classes that are
> loaded from a shared class loader in Tomcat (i.e. from the
> "$CATALINA_HOME?lib"  directory, for example) are global to all web apps,
> even across virtual hosts.  Static variables declared in such classes, for
> example, have only one instance across all web apps.
> 
> However, I would *****strongly***** urge you to reconsider your overall
> application architecture if you are tempted by depending on this kind of
> feature (even though shared libraries of some sort are very commonly
> implemented).  Dependence on global context like this (instead of writing
> APIs to an abstract persistence layer) is just going to get you into
> trouble later with scalability and maintainability issues.  You'd be much
> better off designing your individual web applications as modularly as
> possible -- delegate any required state sharing to mechanisms to get
> common persistence layer objects from whatever storage mechanisms you are
> using.
> 
> If you decide not to heed this advice (yes, I know, it is a lot more work
> up front), then don't expect any sympathy from me when you run into
> barriers trying to expand and enhance your application in the future.
> 
> Craig McClanahan


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message