tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: Global caching hack?
Date Fri, 16 Jun 2000 16:55:27 GMT
Nacho wrote:

> Why you aren't using a singleton? do you know singletons?
>
> Saludos ,
> Ignacio J. Ortega
>

Singletons can be problematic in web applications, because what actually
happens depends on the way class loaders are implemented in your servlet
container.  The portable approach to sharing things throughout a web
application is to use context attributes (from the servlet perspective),
which are the same as application-scope beans (from the JSP perspective).

Craig McClanahan


>
> > -----Mensaje original-----
> > De: Robin Giese [mailto:rtg@digitalkiwi.com]
> > Enviado el: viernes 16 de junio de 2000 11:14
> > Para: tomcat-dev@jakarta.apache.org
> > Asunto: Global caching hack?
> >
> >
> > Hi,
> >
> > I was wondering how I'd be able to hack my own global cache
> > (or rather,
> > bunch o' variables) into Tomcat that would be available to
> > all servlets and
> > JSP pages. I'm trying to share an Oracle connection pool (and a couple
> > similar, global, very large, non-session dependent objects) to all my
> > servlets and JSPs, and I don't want to build a different
> > cache for each
> > servlet and JSP page, because it would be an incredible waste
> > of memory.
> > Where would be the right place for this kind of hack? Or is there an
> > existing facility I could hack up to make it not a complete
> > hack? (However,
> > the objects aren't serializable.)
> >
> > Thanks,
> >
> > --robin
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message