Re: Problem

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: mauricio(dot)solis(dot)h(at)gmail(dot)com, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Problem
Date: 2009-03-31 08:31:34
Message-ID: 49D1D4E6.8000709@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Albe Laurenz wrote:
> Mauricio Solis wrote:
>> I have a problem wiht de driver.
>>
>> If the IP address of the postgresql server is wrong, then the aplication
>> take a lot of time in finish, iven I try to set
>> DriverManager.setLoginTimeout(3), but the problem still.
>>
>> I used a sniffer (tcpdump) and I realiced that my java aplication insist
>> in try to connect to the wrong IP. How I can finish the aplication when
>> the IP server is wrong ???
>
> I don't think that you run into the login timeout here, you rather encounter
> a TCP timeout. Before JDBC can connect, a TCP connection must be established.
> Since the destination IP address does not exist, your computer is sending
> SYN requests that do not receive an answer until the TCP layer "gives up".

Yes, but if you set a login timeout the driver will do the connect in a
separate thread, so while that thread is indeed blocked waiting for a
TCP-level timeout, the main application thread should not remain blocked.

Mauricio, do you have a testcase that shows the problem?

-O

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2009-03-31 12:13:03 Re: Bug with duplicate column names via JDBC MetaData (ORDINAL_POSITION)
Previous Message Albe Laurenz 2009-03-31 07:53:39 Re: Problem