pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <ringerc@ringerc.id.au>
To: Dave Cramer <pg@fastcrypt.com>
Cc: Mikko Tiihonen <Mikko.Tiihonen@nitorcreations.com>
Cc: Sérgio Saquetim <sergiosaquetim@gmail.com>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Cc: Rafael dos Santos Silva <xfalcox@gmail.com>
Subject: Re: Severe performance degradation when using the 9.2-1000 JDBC 4 driver
Date: Thu, 18 Oct 2012 20:48:41 +0800
Message-ID: <507FFAA9.3060902@ringerc.id.au> (raw)
In-Reply-To: <CADK3HH+QvASPUKaSgiYCPqVzYFtoY+5HYBLjg0NgwazJK_CK2Q@mail.gmail.com>
References: <CACLs3uCrjXaY94ivGQgoXDfe-2dwxwsHdPXrA3ey+eL7TPQEJA@mail.gmail.com>
	<d2b756c0-cb16-4a4b-a893-33042a2d28a9@googlegroups.com>
	<507FC5EA.6070905@ringerc.id.au>
	<51061EFB789B4A45AC6598C83649B7BE8DB56604@NBL-EXCD1-01.nebula.local>
	<507FF3A2.4040306@ringerc.id.au>
	<CADK3HH+QvASPUKaSgiYCPqVzYFtoY+5HYBLjg0NgwazJK_CK2Q@mail.gmail.com>

On 10/18/2012 08:43 PM, Dave Cramer wrote:
> On Thu, Oct 18, 2012 at 8:18 AM, Craig Ringer <ringerc@ringerc.id.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




view thread (25+ messages)  latest in thread

Message-ID: <507FFAA9.3060902@ringerc.id.au>
Permalink:  ../507FFAA9.3060902@ringerc.id.au/
Also on:    postgresql.org/message-id/507FFAA9.3060902@ringerc.id.au

 · 

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: ringerc@ringerc.id.au, pg@fastcrypt.com, Mikko.Tiihonen@nitorcreations.com, sergiosaquetim@gmail.com, xfalcox@gmail.com
  Subject: Re: Severe performance degradation when using the 9.2-1000 JDBC 4 driver
  In-Reply-To: <507FFAA9.3060902@ringerc.id.au>
  References: <CACLs3uCrjXaY94ivGQgoXDfe-2dwxwsHdPXrA3ey+eL7TPQEJA@mail.gmail.com> <d2b756c0-cb16-4a4b-a893-33042a2d28a9@googlegroups.com> <507FC5EA.6070905@ringerc.id.au> <51061EFB789B4A45AC6598C83649B7BE8DB56604@NBL-EXCD1-01.nebula.local> <507FF3A2.4040306@ringerc.id.au> <CADK3HH+QvASPUKaSgiYCPqVzYFtoY+5HYBLjg0NgwazJK_CK2Q@mail.gmail.com> <507FFAA9.3060902@ringerc.id.au>

* 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