File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Sometimes not receiving IOException on URL.openconnection Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Sometimes not receiving IOException on URL.openconnection" Watch "Sometimes not receiving IOException on URL.openconnection" New topic
Author

Sometimes not receiving IOException on URL.openconnection

Steve Liu Steve
Greenhorn

Joined: Sep 05, 2007
Posts: 4
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

Joined: Sep 05, 2007
Posts: 4
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?
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Sometimes not receiving IOException on URL.openconnection
 
Similar Threads
B&S Required interface
Help! Getting IOException and Communication Link error with DB
Hard disk full but no IOException
How to handle a hanging servlet / servlet timeout?
display unicode characters in midlet