|
From: <chr...@em...> - 2002-12-12 14:35:16
|
The problem is unfotunately more complex than that.
A class uniqueness is defined by package + classname + classloader.
Appservers reloads classes into a new classloader. So the static variable in
generation 1 is in fact another static variable than that in generation 2.
Tomcat might actually be the only appserver handling reloads *right*. Our
"fix" (taken from some code I wrote for another project) presupposes that
threads from unloaded classes are still allowed to perform actions. I'n
Tomcat the thread is obviously denied even access to JDK classes.
The problem here is to find a "hook" that notifies us when the application
is about to be unloaded. Java does unfortunately not provide a static
'finalize' method.
Me and Bill have been looking at this problem today and I think we simply
have to roll back to the old Proxool solution. This reqires that
"ProxoolFacade#removeAllConnectionPools" is called from user code before the
application is reloaded/closed.
That is: Your problem is simply solved by calling
"ProxoolFacade#removeAllConnectionPools" from the 'destroy' method of a
servlet in your app.
This reintroduces an external dependency to Proxool that we tried to remove
with the system properties hack. Since this hack actually depends on
erroneous behaviour of appservers it can not be trusted, as the Tomcat case
exaplifies.
Oh well ;)
CHR
> -----Original Message-----
> From: pro...@li...
> [mailto:pro...@li...]On Behalf Of Bas
> Cancrinus
> Sent: 12 December 2002 14:00
> Cc: Proxool Developer List
> Subject: Re: [Proxool-developer] Re: Proxool and web apps
>
>
> Martin Crawford wrote:
> > security policy to deny this. A file would be the most logical
> and friendly
> > solution, although how and where you put that file without using System
> > Props is beyond me, I guess another configurable property. Although
>
> Can't you work around the problem with static variables? Like:
>
> private static boolean reloadFlag;
>
> static {reloadFlag = true;}
> protected ReloadMonitor(...) {
> ...
> reloadFlag = false;
> }
> protected boolean isProxoolReloaded() {
> if (reloadFlag) {
> ...
> return true;
> } else {
> return false;
> }
> }
>
> Please let me know what you think.
>
> Kind regards,
> Bas
>
> --
> Bas Cancrinus -> ba...@ci...
> Software Architect
> Cipherware Ltd. -> http://www.cipherware.com
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:
> With Great Power, Comes Great Responsibility
> Learn to use your power at OSDN's High Performance Computing Channel
> http://hpc.devchannel.org/
> _______________________________________________
> Proxool-developer mailing list
> Pro...@li...
> https://lists.sourceforge.net/lists/listinfo/proxool-developer
|