Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

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: Tue, 31 Mar 2009 21:31:34 +1300
  • Message-id: <49D1D4E6.8000709@opencloud.com> <text/plain>

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



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group