Re: How to detect when a connection times out ?

From: Joe Weinstein (joeNOSPAM_at_bea.com)
Date: 08/25/04


Date: Wed, 25 Aug 2004 09:38:16 -0700
To: Leny <leny00004@hotmail.com>


Leny wrote:

> Hi,
>
> I'm looking for a standard way to know when a connection has been
> timed out.

Hi. There is no standard way. Choose a query or call that you are sure has to go to the
DBMS, and is as fast and uncontentious as possible.

> Right now, I found the following solutions:
>
> - Make a query and check out the result. If it's an exception,
> reopen the connection.

That's the only way. Also note that the connection could go bad immediately after your
test query succeeded... The fundamental fact is that a client can never know if it's
next attempt to talk to the server will succeed.

> - Just check every exception for every query.
>
> Well, as you can see they are far from ideal solutions. I just
> can't check the isClosed() because it only returns true when the
> *client* closes the connection.
>

Correct. That is the JDBC spec.

> Do you know any way to know if the connection is active ? Any
> comments would be really welcome.
>
> Thanks in advance,
>
> - Leny



Relevant Pages

  • Re: Effective Range/Throughput - Comparisons and review - (see postings 31-01-06)
    ... different speeds until you run out of walking room. ... sensitivity change versus connection speed. ... attenuation result in far worse range loss. ... Standard Antennae and Original FW. ...
    (alt.internet.wireless)
  • Re: Security. WPA?/-TKIP /-CCMP
    ... key for each connection. ... n parts of the standard. ... even when each client got his own key. ... WPA-Enterprise mode and set up your radius server on your network. ...
    (alt.internet.wireless)
  • Re: Network Performance 1GB ports
    ... Getting 500Mb/s+ throughput on a standard PC is pretty good. ... The reason you only get 88% on a 100MB/s connection is because you can't ... I know it's a RAM to RAM test, that's why I said that a 'real life case' ... And I'm not entirely sure where PC hardware is nowadays. ...
    (comp.dcom.sys.cisco)
  • Re: Warner Brothers chooses Blue Ray
    ... order to get rid of the switcher box. ... I've got a standard satellite-to-TV set up, ... what I'm asking about is the connectors in the connection ... component ports) look better on HDTV than they do now? ...
    (rec.arts.tv)
  • Effective Range/Throughput - Comparisons and review - (see postings 31-01-06)
    ... in which as the author writes that one can expect an indoor ... Standard Antennae and Original FW. ... Little chance of considering a real Office Client/Server connection. ... At 150m the signal/connection dropped too often] ...
    (alt.internet.wireless)