I have been through these questions - choose a db connection pool , Is DB connection pooling all that important and java - DataSource for standalone application - no application server
and those don't answer my curiosity.
What I have is a standalone multi threaded Java application which is supposed to perform a data load to DB in an off or low load window but has to be fast enough to complete within a limited time.
Number of Java threads are configurable but limited to a maximum number.
As far as DB connections go, I am currently getting a new connection for each thread and closing it down when that thread is done. My reasons of not using third party DB connection pool are,
1.Number of maximum Java threads are limited to fixed limit and that limit is manageable by DB ( Its DB2 database )
2.Avoid unnecessary wait for connection from DB pools and avoid clash or wait times among multiple threads ( in case no connections in pool are free )
so in my scenario, would DB connection pool really be needed or would I face any challenges in long run or would that just be a nice to have feature?
Connection Pools make sense in case of web apps since you don't know number of requests/threads in advance but I am not sure about any advantage for standalone apps with fixed max threads.
I am thinking of using C3P0 connection pools if needed.