Re: Database reset connection

Поиск
Список
Период
Сортировка
От Dave Cramer
Тема Re: Database reset connection
Дата
Msg-id CADK3HHJZFL8SzE7woxzR7bfS=Lt0s9W1NBA=LPT7x5EQ=RLKEQ@mail.gmail.com
обсуждение исходный текст
Ответ на Database reset connection  (Manoj Palhade <reply.manoj@gmail.com>)
Список pgsql-jdbc

On 30 November 2016 at 06:18, Manoj Palhade <reply.manoj@gmail.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,



 

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Manoj Palhade
Дата:
Сообщение: Database reset connection
Следующее
От: rob stone
Дата:
Сообщение: Re: Database reset connection