I was just thinking that in a large web application where tens of connections are made to database for every client using the application, there is a possibility that very few of the connections are gone unclosed. Though it is strictly up to us that we must close all connections explicitly but, you know, there may be mistakes. If this happens then after some days we may find that our connection pool has reached its maximum size and the application is not running being unable to get a connection.
Actually I am facing this problem for one of my projects and whenever the connection pool reaches its maximum size I just restart the server which is not good.
I am curious to know how to handle this issue in a better manner and I want to know that is there such a thing that I can close all the unused active connections in my connection pool explicitly in a regular interval e.g every 72 hours using java code ?
I am talking about Java/J2ee technologies and my server is Glassfish Application Server2.1.
EDIT: I am using the connection pool that Glassfish Application server provides within, not any third party connection pool and using this pool using JNDI DataSource.
need your suggestions........
Thanks