permaculture playing cards*
The moose likes Java in General and the fly likes Question on destroy() fro Pool Manager and Lists Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Question on destroy() fro Pool Manager and Lists" Watch "Question on destroy() fro Pool Manager and Lists" New topic
Author

Question on destroy() fro Pool Manager and Lists

Dan Bizman
Ranch Hand

Joined: Feb 25, 2003
Posts: 387
What is the best way to "destroy" a Connection Pool Manager? Currently what I do is I loop through both of my lists and remove each connection from the list, remove the listener for each connection, and close the physiscal connection. However, i was thinking that maybe I should go a few steps further:
1. Set each list to null?
2. Set a flag saying it has been destroyed so no method can be called?
The problem I see is that this does add a bit more complexity to the whole manager that may not be necessary, and it DOES make each method a teeny bit slower. Granted, it may seem insignificant to add one or two extra if statements, but that small addition to numerous methods which may be called thousands of times can really add up. And a pool manager has to be as fast as possible (while remaining integrity). What do you all think?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question on destroy() fro Pool Manager and Lists