Re: Severe performance degradation when using the 9.2-1000 JDBC 4 driver

From: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
To: Dave Cramer <pg(at)fastcrypt(dot)com>, Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
Cc: Mikko Tiihonen <Mikko(dot)Tiihonen(at)nitorcreations(dot)com>, Sérgio Saquetim <sergiosaquetim(at)gmail(dot)com>, "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>, "Rafael dos Santos Silva" <xfalcox(at)gmail(dot)com>
Subject: Re: Severe performance degradation when using the 9.2-1000 JDBC 4 driver
Date: 2012-10-19 01:15:52
Message-ID: 0A3221C70F24FB45833433255569204D08B08188@G01JPEXMBYT03
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

> From: pgsql-jdbc-owner(at)postgresql(dot)org
> On Thu, Oct 18, 2012 at 8:18 AM, Craig Ringer <ringerc(at)ringerc(dot)id(dot)au> wrote:
> > On 10/18/2012 05:17 PM, Mikko Tiihonen wrote:
> >>
> >> I think the DNS lookup is part of the JDBC failover connection patch
> >> that I created.
> >> I initially used a InetSocketAddress.getHostString() that does not do
> >> any DNS lookups, but since that method was added in Java7 I had to
> >> revert to
> >> getHostName() method which does.
> >>
> >> I see following options:
> >
> >
> > 0) Revert the JDBC failover patch or require a connection parameter to
> > enable it
> >
> >
> >> 1) modify the code so that is uses reflection and if Java7 is
> >> detected it will use the no-lookup method
> >
> >
> > Gah! no! Not only will this not work in most SecurityManager contexts,
> > but it's slow and horrid.
>
> Surely there must be a way to detect that you are on Java7 without reflection ?

System.getProperty("java.version") will do.

http://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html

+1 to choice 1.

Regards

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2012-10-19 01:19:47 Re: Severe performance degradation when using the 9.2-1000 JDBC 4 driver
Previous Message Sérgio Saquetim 2012-10-18 13:18:05 Re: Severe performance degradation when using the 9.2-1000 JDBC 4 driver