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

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: Dave Cramer <pg(at)fastcrypt(dot)com>
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-18 12:48:41
Message-ID: 507FFAA9.3060902@ringerc.id.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On 10/18/2012 08:43 PM, Dave Cramer wrote:
> 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 ?

Detect, trivially, but if code that refers to a method that doesn't
exist in Java 7 is loaded it'll cause a link error from memory - so you
can't actually get to the point where you test the condition when
running in Java 6.

I'll write a toy test class to confirm that and check back.

--
Craig Ringer

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message emergency.shower@gmail.com 2012-10-18 13:10:21 Re: Severe performance degradation when using the 9.2-1000 JDBC 4 driver
Previous Message Dave Cramer 2012-10-18 12:43:15 Re: Severe performance degradation when using the 9.2-1000 JDBC 4 driver