Re: After server restart I get - An I/O error occured while sending to the backend.

Поиск
Список
Период
Сортировка
От Rod
Тема Re: After server restart I get - An I/O error occured while sending to the backend.
Дата
Msg-id AANLkTimc7p5W-y7QQx7dXExPXGpIp8jr9AfLJZTdNUya@mail.gmail.com
обсуждение исходный текст
Ответ на Re: After server restart I get - An I/O error occured while sending to the backend.  (Craig Ringer <craig@postnewspapers.com.au>)
Ответы Re: After server restart I get - An I/O error occured while sending to the backend.  (Thomas Kellerer <spam_eater@gmx.net>)
Re: After server restart I get - An I/O error occured while sending to the backend.  (Craig Ringer <craig@postnewspapers.com.au>)
Список pgsql-jdbc
I find it hard to believe! We live in 21st century, year 2010.
Electric cars and black president. And there's still no connection
pool library that keeps track if connection is valid or not?


On Tue, May 18, 2010 at 9:42 PM, Craig Ringer
<craig@postnewspapers.com.au> wrote:
> On 18/05/2010 6:41 PM, Rod wrote:
>>
>> Hi,
>>
>> I have simple JDBC client app running on Jetty.
>> Using 8.3 JDBC3 driver and PostgreSQL8.3 server running on localhost.
>>
>> Any time I restart the PostgresQL server I get SQL error:
>> An I/O error occured while sending to the backend.
>>
>> It appears that my application's connection to the server is not
>> re-established by some reason?
>
> Pooled connections usually don't get cleaned up until they're discovered to
> be dead. That happens when you try to use them and they break.
>
> Just be prepared for this to happen. If you get a bad connection, grab a new
> one and re-try your work.
>
> Yes, you can "test" the connection first ... but something might go wrong
> with it between testing it and starting to use it. You need to be prepared
> to handle failure at any point and re-try your work. Make sure to keep your
> work separated into clear units of work (wrapped as transactions) so you
> have a clear idea of what you're up to.
>
>>
>> I am no expert in JDBC.
>> First I was using plan JDBC. I thought that using DB connection pool
>> will automagically reconnect and solve this problem.
>> Switching to Apache commons DBCP did not change anything.
>>
>> What am I supposed to do to make it survive PostgreSQL server restart?
>
> It can't, just as it can't survive connection loss for other reasons. Your
> code must be prepared to deal with that.
>
> --
> Craig Ringer
>

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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Using java.lang.Character for "char" data type
Следующее
От: Thomas Kellerer
Дата:
Сообщение: Re: After server restart I get - An I/O error occured while sending to the backend.