Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sometimes not receiving IOException on URL.openconnection

 
Steve Liu Steve
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My servlet accesses DB via a URL invoke.
This has been working fine for long time
However, today, when the DB went down, I found that the IOException was sometimes not being thrown. The openConnection never comes back and the socket handle appears stuck. As this happens more and more, it reaches the max filehandle and stops processing requests.

Question: why am I sometimes not getting an IOException?
What can I do so that my filehandles don't run out?
java 1.4.2_05 tomcat 4.1
 
Steve Liu Steve
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmmm... probably should have been moved to the Sockets and Internet Protocols forum instead... but whatever.

anyhow, I found this:
http://www.velocityreviews.com/forums/t130657-httpurlconnection-timeout-solution.html

I'm going to try to implement it and see if I can get better reliability and control on the socket. Anyone try it? Anyone has advice on how well or not it works?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic