-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John,

John Shilling wrote:
> Do people really do option #1 in a production environment?

Sure.

> I can figure out how to set up realms for initialization parameters
> but it is still a single class namespace within the Tomcat container,
> right?

Not really. One of the container's jobs is to isolate webapps from each
other so they don't interfere.

> It seems that special care must be taken with singleton objects (such
> as the Hibernate Session Factory) so make sure that they are managed
> in the context of their Virtual Host/App Instance.

Yes. Each webapp gets its own ClassLoader which loads classes from that
webapp's WEB-INF/lib/*.jar files. Assuming that your webapps are
self-contained, even singletons should operate correctly "alongside"
each other in different webapps. I'm not expert at Tomcat internal
workings, but I expect that the level of isolation between two webapps
in the same Virtual Host is the same as the level of isolation between
two webapps in different Virtual Hosts.

> Are there established practices for doing #1?

Do not put any libraries in the server's shared class loaders unless
it's okay that they actually be shared. For instance, don't shove
Hibernate's JAR in there so you can save a little memory by sharing the
classes. If you do that, you've "crossed the streams" so to speak.

The main thing I would be worried about is the apps stealing time from
each other. There's not a whole lot you can do about that except get
more hardware. There's also the possibility of upgrades and such. do you
want to be able to run some clients/customers on different versions of
your application that require different JVMs, for instance? It should be
obvious that a Tomcat instance must run on only one JVM at a time ;)

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkkcdkACgkQ9CaO5/Lv0PA89QCgjkZxgWiQTi/9tAN0WiiDpKoF
pCgAn06jbdr4DDysNXNfLoK8uRP9DqLm
=fOpP
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to