Re: This connection has been closed

From: Samuel Gendler <sgendler(at)ideasculptor(dot)com>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: Magosányi Árpád <mag(at)magwas(dot)rulez(dot)org>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: This connection has been closed
Date: 2011-12-06 07:55:12
Message-ID: CAEV0TzC=GHv+hvZtFp-hu8KGy0B-AE3oFv=iBeqo0df9LCbw+w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

>
> On 6 December 2011 19:10, Magosányi Árpád <mag(at)magwas(dot)rulez(dot)org> wrote:
> > I am using a cdo server (org.eclipse.emf.cdo) which uses hibernate which
> > uses the postgresql jdbc driver. (9.0.0.801)
> > Between two transactions the tcp connection between the cdo server and
> > postgresql went down (my laptop hibernated).
> > I got an exception with this cause:
> >
> > Caused by: org.postgresql.util.PSQLException: This connection has been
> > closed.
> > at
> >
> org.postgresql.jdbc2.AbstractJdbc2Connection.checkClosed(AbstractJdbc2Connection.java:714)
> > at
> >
> org.postgresql.jdbc2.AbstractJdbc2Connection.getAutoCommit(AbstractJdbc2Connection.java:680)
> > at
> >
> org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:127)
> > at
> >
> org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
> >
> > This might be related to this issue:
> > https://forum.hibernate.org/viewtopic.php?f=1&t=957369
> >
> > Do we have a hibernate, a postgresql or a CDO issue here?
>
>
If you're using a 3rd party connection pool, I don't believe there is a
contract that they will necessarily validate that a connection is still
open before returning it. Most pools can be configured to issue a 'select
1' type of query on a periodic basis to keep connections from timing out,
or just to validate that a connection is still alive before returning it
from the pool.

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Walter Hurry 2011-12-06 19:43:24 Re: JDBC with SSL
Previous Message Oliver Jowett 2011-12-06 06:52:15 Re: This connection has been closed