Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Firewall timing out connections in Pool - Commons DBCP

 
O. Ziggy
Ranch Hand
Posts: 430
Android Debian VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

Here are my default values on the pool
 
dema rogatkin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic