Re: db sever seems to be dropping connections

Поиск
Список
Период
Сортировка
От Vivek Khera
Тема Re: db sever seems to be dropping connections
Дата
Msg-id 2D73F6FA-E6DE-42F2-9743-8028C133B2FF@khera.org
обсуждение исходный текст
Ответ на Re: db sever seems to be dropping connections  ("Rushabh Doshi" <rdoshi@vmware.com>)
Список pgsql-general
On Mar 21, 2006, at 4:39 PM, Rushabh Doshi wrote:

> This is my problem. I have a connection to the database using DB-
> >connect.
> Apparently, this connection sits idle for around an hour or so
> because of my
> application, and after that it has to do something. So I check that
> if the
> handle is still a valid one or not. If it's not, then re-establish the

I see you're using DBI.

When you detect the dead connection, you need to close it immediately
so that later on it will not attempt a disconnect.  What you probably
also want is to tell DBI not to try to do any cleanup on it since the
connection is already lost.  You do this by setting

  $dbh->{InactiveDestroy} = 1

before you undef $dbh.


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

Предыдущее
От: Richard Jones
Дата:
Сообщение: ANNOUNCE: Type-safe interface to PostgreSQL
Следующее
От: Vivek Khera
Дата:
Сообщение: Re: Advantages of PostgreSQL over MySQL 5.0