Re: Connection exceptions

Поиск
Список
Период
Сортировка
От Thomas Finneid
Тема Re: Connection exceptions
Дата
Msg-id 4A3CA154.4090205@fcon.no
обсуждение исходный текст
Ответ на Re: Connection exceptions  (Craig Ringer <craig@postnewspapers.com.au>)
Список pgsql-jdbc
Craig Ringer wrote:
> Most of your question really deals with the connection pooler you're
> using, rather than JDBC its self. I'd start with the documentation for
> DBCP.

I have looked at it, and its really poor, but I'll look for a mailing
list to see if I can get answers there.

Not sure if anybody here can answer this question, but one thing I dont
understand is the separation between DBCP and the pooler and who do
what. Apparently they are two different apache-commons packages.
Anybody know anything about these details or where I can find any
documentation or articles about it?

> shouldn't care at what point in the process the exception was thrown.
> When you catch it, you can test the SQLState to see if the error is
> possibly transient and be prepared to retry the operation. (deadlocked
> transaction? OK, retry. Connection broken? Obtain a new connection and
> retry. etc)

My main algorithm is to not care, but as soon as a problem occurs,
return the connection to the pool and let the pool deal with its
condition, then get a new connection and try again. Repeat three times
and then fail by throwing an exception to the client (after appropriate
cleanup and logging.)

regards

thomas

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Connection exceptions
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: text type handling