Hi

> No, this is just an example.  What I'd like to know is if stop/start or
reload has the same effect on a webapp as actually shutting down tomcat and
starting it back up.

When you stop an webapp, its classloader is discarded. Therefor every
information held by you classes is discarded.
Whey you restart an webapp, a new classloader is instantiated for that
webapp and every class is loaded from scratch. Static vars and such are
all-new.

Problems occur, if you pass references of you classes to elements outside
you classloader (in example by using shared libraries).
In that case, the classes referenced from outside your webapp cannot be
discarded due to javas typesafe pointers.
This might result in the existence of the same static variable in two
classloaders. Remember that these are two distinct variables.
Even worse, if you manage to get the reference in the old classloader from
the shared library it won't be even the same type as it was before since
Classes loaded from different classloaders are type-different.

Hence avoid to even try to find a way to make information persistent to
webapp reloads without writing them somewhere outside the VM.

HTH

Steffen


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to