I am using the Commons DBCP connection pool to manage my connections. Everything works fine but recently i found out that every morning i try to make a request, the application takes at least 9 minutes to process the request. Subsequent requests take just seconds.
I have tried to trace this and found out that since i set the connection pool to keep at least two connections alive, the next day i try to make a connection these two connections are reused. The problem is there is a firewall which resets every connection after every hour.
So the problem is the firewall is invalidating the connections and its taking my application too long to find out that a connection has been reset before it creates a new one.
I could try and re-write the DBCP connection pool to send "keep alives" but i dont think this is wise as how will i know which connection to send the keep alive for?
Does anyone have any idea how i can solve this? Or is there a setting on DBCP that will do this for me?
We had a similar problem, so we set life time for a connection to 30 minutes. However we use a home made pool. I noticed that WL connection pool gives the same level of control, even better. So check documentation for your connection pool, it's common problem and should be covered by settings.
Tough in space?, <a href="http://tjws.sf.net" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="http://mediachest.sf.net" target="_blank" rel="nofollow">Check it here.</a><br /><a href="http://7bee.j2ee.us/book/Generics%20in%20JDK%201.5.html" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="http://7bee.j2ee.us/bee/index-bee.html" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="http://7bee.j2ee.us/addressbook/" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="http://searchdir.sourceforge.net/" target="_blank" rel="nofollow">How to promote your business with a search engine</a>