How to retry when connection has been closed?

Поиск
Список
Период
Сортировка
От Herouth Maoz
Тема How to retry when connection has been closed?
Дата
Msg-id 200908021212.56184.herouth@unicell.co.il
обсуждение исходный текст
Ответы Re: How to retry when connection has been closed?
Список pgsql-jdbc
Good day.

We are upgrading a legacy system from Sybase to Postgres. In one of the
modules, we wish, if an SQLException is caught, to close and reopen the
connection and retry - but only if the cause of the Exception is a dropped
connection. The original developer of the code implemented this by searching
for the substrings "Broken pipe" or "Connection already closed" in the
exception message.

Is there a more elegant way to find out whether the connection has been
dropped from within the catch clause?

And if not, I assume the above substrings are no longer pertinent - what
messages in PostgreSQL indicate a dropped connection?

Thank you,
Herouth

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

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Datatype of domains not reported correctly.
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: How to retry when connection has been closed?