• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Sometimes not receiving IOException on URL.openconnection

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
If you two don't stop this rough-housing somebody is going to end up crying. Sit down and read this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic