Solved

URLConnection timeout in JDK 1.0.2

Posted on 1998-02-06
2
158 Views
Last Modified: 2010-04-16
I am calling URL's from my applet with some specified parameters, this URL then performs a query against a database.  These queries can take anywhere from seconds to an hour.  With the longer queries, java receives an IOException after about 10 minutes of waiting.  Is there any way around this behavior?

Also, when I try to recover from this IOException, the next call to the web server isn't accepted.  Is this because these two requests are in the same thread and it thinks the other connection is still open?  The other connection shouldn't still be open though, as I call my closing method in the finally block after I catch the first IOException.

Any help would be appreciated.  Thanks.
0
Comment
Question by:lmarlow
2 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 100 total points
Comment Utility
I don't believe that you can change this behavior.  At least not in your Java application.  I think you are running into an underlying operating system timeout that is eventually getting back to Java as an error.  How about another suggestion?  Instead of just having the connection sit idle while your query processes, how about sending back a progress update every so often?  Not only would this keep the time-out from happening, it might pacify your savage user who doesn't know why the darned thing is taking so long.
0
 

Author Comment

by:lmarlow
Comment Utility
So, if I was to send back some sort of progress indicator, the OS would think that the connection was still alive, and keep it open?  Or does would it close it after 10 minutes anyway, just because it doesn't like to have HTTP requests open for more than 10 minutes?

Do you have any idea why the web server wouldn't accept another request while the initial page was being processed?
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
strCopies  challenge 17 73
mapBully challenge 6 86
JAVA part two 5 39
get weblogic logged in user in java 2 38
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now