Re: Database reset connection

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Manoj Palhade <reply(dot)manoj(at)gmail(dot)com>
Cc: List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Database reset connection
Date: 2016-11-30 12:20:20
Message-ID: CADK3HHJZFL8SzE7woxzR7bfS=Lt0s9W1NBA=LPT7x5EQ=RLKEQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On 30 November 2016 at 06:18, Manoj Palhade <reply(dot)manoj(at)gmail(dot)com> wrote:

> Hi,
>
> I have Java class which implements the Database(Postgres) related
> functionality.
>
> The problem is if Database stopped and then restart then My this class
> throws SQLException as connection got reset(database is up and running).
>
> Is there any way that after Database restarted; my class automatically
> Connection to database and work as expected instead of throwing
> SQLException.
>
> Is there anyway with Properties as a parameter to
> DriverManager.getConnection().
>
> Thanks and Regards,
> Manoj Palhade
>
>
It really isn't that simple. What happens if the database never comes back?
This is why the application has to handle this. It should be trivial for
you write a wrapper that retries intelligently to reconnect.

Regards,

Dave Cramer

davec(at)postgresintl(dot)com
www.postgresintl.com

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message rob stone 2016-11-30 12:28:42 Re: Database reset connection
Previous Message Manoj Palhade 2016-11-30 11:18:21 Database reset connection