pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: yoursoft@freemail.hu <yoursoft@freemail.hu>
To: pgsql-jdbc@postgresql.org
Subject: Re: [Fwd: Re: JDBC driver bug?]
Date: Fri, 23 Sep 2005 09:24:30 +0200
Message-ID: <4333ADAE.3030302@freemail.hu> (raw)
In-Reply-To: <s332b385.058@gwmta.wicourts.gov>
References: <s332b385.058@gwmta.wicourts.gov>

Dear Csaba, Dear Kevin,

Thanks for suggestion. I'm using Windows only for development. The 
solution is working fine for me.

Regards,
    Ferenc

Kevin Grittner wrotte:

>I can confirm that this is an issue in JDK 1.5 (a/k/a Java5) in
>Windows.  This is not the fault of postgres, but like others have
>suggested, it is with reverse DNS lookup.  It affects all TCP
>connections.
>
>If you connect to an IP address it attempts to look up the name,
>resulting in these delays.  To confirm, add the ip address with
>some name to the hosts file, normally in the
>system32\drivers\etc directory under your main windows
>directory.
> 
>-Kevin
> 
> 
>  
>
>>>>Csaba Nagy <nagy@ecircle-ag.com> 09/22/05 9:46 AM >>>
>>>>        
>>>>
>I'm forwarding this to the list too. It's best to hit "reply to all"
>when replying to mails to the postgres lists...
>
>-----Forwarded Message-----
>From: Csaba Nagy <nagy@ecircle-ag.com>
>To: yoursoft@freemail.hu <yoursoft@freemail.hu>
>Subject: Re: [JDBC] JDBC driver bug?
>Date: Thu, 22 Sep 2005 16:42:30 +0200
>
>OK, in this case you might have a problem of reverse DNS. Depending on
>how the JDBC driver is using the Java networking code it might happen
>that Java tries to look up the host name for the IP. 
>
>In any case if there's different behavior when you run locally against
>when you run from another host on the network, it is quite obviously
>network related.
>
>Try to use the host name instead of the IP and make sure the IP can be
>resolved locally (on linux put it in /etc/hosts, on Windows in lmhosts I
>guess, but I didn't touch a windows for quite long time).
>
>HTH,
>Csaba.
>
>On Thu, 2005-09-22 at 16:23, yoursoft@freemail.hu wrote:
>  
>
>>Dear Csaba,
>>
>>Thanks, for you fast answer.
>>I use the following format of the connection: con = 
>>DriverManager.getConnection("jdbc:postgresql://10.1.1.1/dbname", "user", 
>>"pwd");
>>I think with the direct IP address not need to use the DNS server. It is 
>>true?
>>
>>Regards,
>>    Ferenc
>>
>>Csaba Nagy wrotte:
>>
>>    
>>
>>>This kind of problems usually are caused by your network/networking code
>>>and not postgres itself. I bet there's some DNS resolution overhead and
>>>the different java versions you're using have different DNS
>>>resolution/caching policies. I would take a look at DNS as a first
>>>suspect.
>>>
>>>HTH,
>>>Csaba.
>>>
>>>
>>>On Thu, 2005-09-22 at 15:25, yoursoft@freemail.hu wrote:
>>> 
>>>
>>>      
>>>
>>>>Dear Developers,
>>>>
>>>>First, sorry my bad English.
>>>>My platform:
>>>>- postgresql 8.0.3 and 8.0.0 with SuSE Linux.
>>>>- java 1.5 update 4 (problem with it), java 1.4.2 (working without problem)
>>>>- jdbc 3 driver 312 (latest stable)
>>>>
>>>>I found the following problem:
>>>>If I connect to the database from local host with java 1.5, or with java 
>>>>1.4.2 from other box everything is good (connection time <1 sec).
>>>>When I connect to the database on other box, there is slow connection 
>>>>(5-6 sec).
>>>>
>>>>If you have any other question, please mail it.
>>>>
>>>>Regards,
>>>>  Ferenc
>>>>        
>>>>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Have you searched our list archives?
>
>               http://archives.postgresql.org
>
>
>  
>




view thread (2+ messages)

Message-ID: <4333ADAE.3030302@freemail.hu>
Permalink:  ../4333ADAE.3030302@freemail.hu/
Also on:    postgresql.org/message-id/4333ADAE.3030302@freemail.hu

 · 

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: yoursoft@freemail.hu
  Subject: Re: [Fwd: Re: JDBC driver bug?]
  In-Reply-To: <4333ADAE.3030302@freemail.hu>
  References: <s332b385.058@gwmta.wicourts.gov> <4333ADAE.3030302@freemail.hu>

* 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