pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Albe Laurenz <laurenz.albe@wien.gv.at>
Cc: mauricio.solis.h@gmail.com
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Problem
Date: Tue, 31 Mar 2009 21:31:34 +1300
Message-ID: <49D1D4E6.8000709@opencloud.com> (raw)
In-Reply-To: <D960CB61B694CF459DCFB4B0128514C202FF651E@exadv11.host.magwien.gv.at>
References: <49CD084B.8000900@gmail.com>
	<D960CB61B694CF459DCFB4B0128514C202FF651E@exadv11.host.magwien.gv.at>

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



view thread (6+ messages)

Message-ID: <49D1D4E6.8000709@opencloud.com>
Permalink:  ../49D1D4E6.8000709@opencloud.com/
Also on:    postgresql.org/message-id/49D1D4E6.8000709@opencloud.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: oliver@opencloud.com, laurenz.albe@wien.gv.at, mauricio.solis.h@gmail.com
  Subject: Re: Problem
  In-Reply-To: <49D1D4E6.8000709@opencloud.com>
  References: <49CD084B.8000900@gmail.com> <D960CB61B694CF459DCFB4B0128514C202FF651E@exadv11.host.magwien.gv.at> <49D1D4E6.8000709@opencloud.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox