Re: Connection time out

Lists: pgsql-jdbc
From: "Lemasson Sylvain" <s(dot)lemasson(at)mak-system(dot)net>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Connection time out
Date: 2003-10-28 08:33:48
Message-ID: 003301c39d2e$35500940$221e210a@PCJ1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Hi,
where can we set the time-out of a connection ?.

Lemasson Sylvain


From: Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk>
To: Lemasson Sylvain <s(dot)lemasson(at)mak-system(dot)net>
Cc: "pgsql-jdbc (at) postgresql (dot) org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Connection time out
Date: 2003-10-28 11:23:02
Message-ID: 20031028112302.A32750@bacon
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc


On 28/10/2003 08:33 Lemasson Sylvain wrote:
> Hi,
> where can we set the time-out of a connection ?.

DriverManager.setLoginTimeout(int seconds);

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+


From: "Lemasson Sylvain" <s(dot)lemasson(at)mak-system(dot)net>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Connection time out
Date: 2003-10-28 14:21:33
Message-ID: 001901c39d5e$ca5a2d60$221e210a@PCJ1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Thank you for your reply thomas, but the setLoginTimout concernes the time a
driver wait while attempting to connect to a database. My question was about
the live time of a connection. I mean when we get a connection, postgres
reset the connection after a time out ("connection reset by peer" error
message). I want to set this time out to infinit but I do not know how.

Lemasson Sylvain
Ingénieur développeur
s(dot)lemasson(at)mak-system(dot)net
tel: 01.48.63.27.27
MAK-SYSTEM SERVICES
Groupe MAK-SYSTEM
Paris Nord 2 - 13, rue de la Perdrix
BP 50035-95946 Roissy CDG Cédex
FRANCE
----- Original Message -----
From: "Paul Thomas" <paul(at)tmsl(dot)demon(dot)co(dot)uk>
To: "Lemasson Sylvain" <s(dot)lemasson(at)mak-system(dot)net>
Cc: "pgsql-jdbc @ postgresql . org" <pgsql-jdbc(at)postgresql(dot)org>
Sent: Tuesday, October 28, 2003 12:23 PM
Subject: Re: [JDBC] Connection time out

>
> On 28/10/2003 08:33 Lemasson Sylvain wrote:
> > Hi,
> > where can we set the time-out of a connection ?.
>
> DriverManager.setLoginTimeout(int seconds);
>
> --
> Paul Thomas
>
+------------------------------+--------------------------------------------
-+
> | Thomas Micro Systems Limited | Software Solutions for the Smaller
> Business |
> | Computer Consultants |
> http://www.thomas-micro-systems-ltd.co.uk |
>
+------------------------------+--------------------------------------------
-+
>


From: Dave Cramer <Dave(at)micro-automation(dot)net>
To: Lemasson Sylvain <s(dot)lemasson(at)mak-system(dot)net>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Connection time out
Date: 2003-10-28 15:42:11
Message-ID: 1067355731.1620.175.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Lemasson,

I would check to make sure that you don't have a firewall between you
and the database. As far as I know the default is infinite.

Check the archives for "dropping connections"

Dave
On Tue, 2003-10-28 at 09:21, Lemasson Sylvain wrote:
> Thank you for your reply thomas, but the setLoginTimout concernes the time a
> driver wait while attempting to connect to a database. My question was about
> the live time of a connection. I mean when we get a connection, postgres
> reset the connection after a time out ("connection reset by peer" error
> message). I want to set this time out to infinit but I do not know how.
>
> Lemasson Sylvain
> Ingénieur développeur
> s(dot)lemasson(at)mak-system(dot)net
> tel: 01.48.63.27.27
> MAK-SYSTEM SERVICES
> Groupe MAK-SYSTEM
> Paris Nord 2 - 13, rue de la Perdrix
> BP 50035-95946 Roissy CDG Cédex
> FRANCE
> ----- Original Message -----
> From: "Paul Thomas" <paul(at)tmsl(dot)demon(dot)co(dot)uk>
> To: "Lemasson Sylvain" <s(dot)lemasson(at)mak-system(dot)net>
> Cc: "pgsql-jdbc @ postgresql . org" <pgsql-jdbc(at)postgresql(dot)org>
> Sent: Tuesday, October 28, 2003 12:23 PM
> Subject: Re: [JDBC] Connection time out
>
>
> >
> > On 28/10/2003 08:33 Lemasson Sylvain wrote:
> > > Hi,
> > > where can we set the time-out of a connection ?.
> >
> > DriverManager.setLoginTimeout(int seconds);
> >
> > --
> > Paul Thomas
> >
> +------------------------------+--------------------------------------------
> -+
> > | Thomas Micro Systems Limited | Software Solutions for the Smaller
> > Business |
> > | Computer Consultants |
> > http://www.thomas-micro-systems-ltd.co.uk |
> >
> +------------------------------+--------------------------------------------
> -+
> >
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
--
Dave Cramer <Dave(at)micro-automation(dot)net>


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Lemasson Sylvain" <s(dot)lemasson(at)mak-system(dot)net>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Connection time out
Date: 2003-10-28 15:55:53
Message-ID: 22557.1067356553@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

"Lemasson Sylvain" <s(dot)lemasson(at)mak-system(dot)net> writes:
> Thank you for your reply thomas, but the setLoginTimout concernes the time a
> driver wait while attempting to connect to a database. My question was about
> the live time of a connection. I mean when we get a connection, postgres
> reset the connection after a time out ("connection reset by peer" error
> message).

I can assure you that the Postgres backend will never do any such thing.
Your problem must be somewhere in the communication pathway.

One likely possibility is that you have an address-translating firewall
(NAT box) between you and the database server. NAT boxes will commonly
forget about connections that have been idle for too long. It may not
be possible to persuade the firewall not to do this --- if you cannot
bypass the firewall, your best bet may be to issue an empty query every
so often to keep the connection alive.

regards, tom lane