ConnectionPool should be refactored to use a ScheduledExecutorService instead of a TimerTask. This would enable providing a custom ScheduledExecutorService to jdbc pool to reduce expensive thread creation in certain environments (in my case: junit tests, where each test case will get a new environment, including a ConnectionPool)
hi Patric, I'm all for this. If you have a patch for this to get us started that would be great. The requirements for the default implementation are 1. No more than 1 thread should ever be started for this task 2. The thread has to be created with the class loader of the library, not of the thread (context classloader) 3. When the last pool is closed that is using the cleaner is closed, the thread should also go away
I just want to add that the current (TimerTask) implementation seems to have a bug which causes that the PoolCleaner Thread will not be terminated/canceled in some cases. I am currently unable to reproduce this but I saw this issue several times.