Re: Simple connection failover support

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Mikko Tiihonen <mikko(dot)tiihonen(at)nitorcreations(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Simple connection failover support
Date: 2012-06-01 22:00:48
Message-ID: CADK3HH+He5hBL6oB9gOUhNiuW2RRirnpJA7xKwqv9hTM5duDaA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Mikko,

I get compile errors

getHostString() is not public in java.net.InetSocketAddress; cannot be
accessed from outside package

compiling with java 6

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca

On Tue, May 22, 2012 at 9:37 AM, Mikko Tiihonen
<mikko(dot)tiihonen(at)nitorcreations(dot)com> wrote:
> Hi,
>
> Here are two patches that add simple failover support to the jdbc driver.
>
> Patch 1 converts all references to pair of host+port variables to single
> InetSocketAddress
> Patch 2 rewrites the url parsing to support multiple host:port pairs and
> modifies the low level connection opening to retry once all listed addresses
> I also added more cases to the unit tests to verify that I did not break any
> functionality.
>
> * The connection url and connection parameters stay backwards compatible
> * If there are commas in the hostname part of the url the new code will use
> them to split the addresses and keep them in the defined priority order
> * If there is any IOException or login failure during the connection phase
> the code will try another listed address
> * I tried to keep the code still Java 1.4 compatible
>
> -Mikko
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Johann 'Myrkraverk' Oskarsson 2012-06-02 15:14:17 Re: Implementing setBinaryStream(int, InputStream, long)
Previous Message Dave Cramer 2012-06-01 21:12:36 Re: JDBC website help !