Hello,
I am facing an issue with FixedThreadPoolExecutor.
So scenario is that I need to load some data in cache from database. For this I run
JDBC queries in database.
Now I need to run those queries in parallel . To get all data quickly.
I start an "newFixedThreadPool" executorService and there is one "Callable" class , say 'X' whose "call" method makes JDBC connection and executes select
queries.
I run a loop of around 5000 and create a new 'X' and submit it to executorService.
Now what i find is that even though I set pool size to some thing say 20 , I can see more than 100 -200 connections made in DB!
I have checked that I am closing connection properly . Also no other process is making any connection.
Is there a way this executorService can do that? The connection is made in "call" and closed there only.
Please suggest
Thanks
Hildich