|
From: Martin C. <mar...@sy...> - 2002-12-12 15:04:00
|
On Thu, 2002-12-12 at 09:32, Christian Nedregard wrote: > 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. > As I was typing my response to why statics would not work this arrived in my box. This article (same guy who wrote Server Based Java from Manning) explains more http://www.javageeks.com/Papers/JavaStatics/index.html > That is: Your problem is simply solved by calling > "ProxoolFacade#removeAllConnectionPools" from the 'destroy' method of > a servlet in your app. > Or, again I'll stress, the correct placement for proxool in a servlet container really should be in a classloader higher in the classloader hierarchy than the web app classloaders. For Tomcat this is either the "common" directory or the "share" directory. I am not familiar if this classloader hierarchy provided by Tomcat is part of the servlet container spec or not so individual implementations my vary. Additionally, it should also be noted that your JDBC drivers must be deployed at either the same classloader level or higher for proxool to recognise them. This has been fun;) Martin |