• Post Reply Bookmark Topic Watch Topic
  • New Topic

Question on destroy() fro Pool Manager and Lists  RSS feed

Dan Bizman
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!