Re: Problem - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Problem
Date
Msg-id 49D1D4E6.8000709@opencloud.com
Whole thread Raw
In response to Re: Problem  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
List 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

pgsql-jdbc by date:

Previous
From: "Albe Laurenz"
Date:
Subject: Re: Problem
Next
From: "Scott Murphy"
Date:
Subject: autogenerated keys is not supported in 8.4dev-700 as specified in the changelog