RE: [Proxool-developer] Re: [Proxool-user] warning messages
UNMAINTAINED!
Brought to you by:
billhorsman
|
From: Michael H. <mh...@ni...> - 2004-04-22 19:46:11
|
...but that on second thought is not the best as it is not
synchronized...
The best solution is just to refactor the meat of the shutdown method
into another method that is then invoked from the shutdownhook.
Something like removeConnections(String finalizer, int delay)....
-----Original Message-----
From: pro...@li...
[mailto:pro...@li...] On Behalf Of
Michael Hoefer
Sent: Thursday, April 22, 2004 12:40 PM
To: Proxool Developer List
Subject: RE: [Proxool-developer] Re: [Proxool-user] warning messages
Yep, I meant 'not'.
Locally I fixed it in perhaps a better way by checking if the hook is
alive:
if (shutdownHook !=3D null && !shutdownHook.isAlive() ) {
ShutdownHook.remove(shutdownHook);
}
If it is alive, it means we are shutting down. Solved the problem as
far as I can tell. Code change is in ProxoolFacade.shutdown(...):
/**
* Removes all connection pools. Kills all the connections. Resets
everything.
* @param finalizer used to identify who is causing the pools to be
removed (helps logging)
* @param delay the time to wait for connections to become inactive
before killing it (milliseconds)
*/
protected static void shutdown(String finalizer, int delay) {
ConnectionPool[] cps =3D
ConnectionPoolManager.getInstance().getConnectionPools();
for (int i =3D 0; i < cps.length; i++) {
removeConnectionPool(finalizer, cps[i], delay);
}
// If a shutdown hook was registered then remove it...only if it
is not active
try {
if (shutdownHook !=3D null && !shutdownHook.isAlive() ) {
ShutdownHook.remove(shutdownHook);
}
} catch (Throwable t) {
if (LOG.isDebugEnabled()) {
LOG.debug("Unanticipated error during removal of
ShutdownHook. Ignoring it.", t);
}
}
}
-----Original Message-----
From: pro...@li...
[mailto:pro...@li...] On Behalf Of Bill
Horsman
Sent: Thursday, April 22, 2004 12:37 PM
To: Proxool Developer List
Subject: Re: [Proxool-developer] Re: [Proxool-user] warning messages
Michael,
On Thu, 2004-04-22 at 20:26, Michael Hoefer wrote:
> Now as far as I've read, you are now allowed to remove shutdown hooks
> after a shutdown has been initiated.
I think you meant "/not/ allowed"?
> ProxoolFacade should be refactored to not remove any shutdown hooks
> when called from the shutdown hook itself. I'm surprised nobody else
> has seen this...am I missing something?
Nope. It's a known problem. The latest code in CVS copes with it, albeit
in a clumsy way. It still tries to remove the shutdownHook but it spots
an IllegalStateException and silently ignores it. Perhaps we could do
that in a smarter way.
- Bill
-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek For
a limited time only, get FREE Ground shipping on all orders of $35 or
more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=3D12297
_______________________________________________
Proxool-developer mailing list
Pro...@li...
https://lists.sourceforge.net/lists/listinfo/proxool-developer
CONFIDENTIALITY NOTICE: The information contained in this message and or
attachments is intended only for the person or entity to which it is
addressed and may contain confidential and/or privileged material. Any
review, retransmission, dissemination, copying, or other use of this
information by persons or entities other than the intended recipient is
prohibited. If you received this e-mail or its attachments in error,
please contact the sender and delete the material from any system and
destroy any copies.
-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek For
a limited time only, get FREE Ground shipping on all orders of $35 or
more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
_______________________________________________
Proxool-developer mailing list
Pro...@li...
https://lists.sourceforge.net/lists/listinfo/proxool-developer
CONFIDENTIALITY NOTICE: The information contained in this message and or=
attachments is intended only for the person or entity to which it is=
addressed and may contain confidential and/or privileged material. Any=
review, retransmission, dissemination, copying, or other use of this=
information by persons or entities other than the intended recipient is=
prohibited. If you received this e-mail or its attachments in error,=
please contact the sender and delete the material from any system and=
destroy any copies.
|