Skip site navigation (1) Skip section navigation (2)

Re: keeping Connection alive

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Andreas <ml(at)3(dot)141592654(dot)de>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: keeping Connection alive
Date: 2009-12-15 02:06:16
Message-ID: 4B26EF18.9060606@postnewspapers.com.au (view raw or flat)
Thread:
Lists: pgsql-jdbc
On 14/12/2009 10:53 PM, Andreas wrote:

> I'm not sure how to do this, because AFAIK a DataSource implementation does not have a method for invalidating the Connection. How to do this when implementing against standard interfaces?

OK, after a little more reading it's clear that if you're using the 
basic javax.sql.DataSource there's no pooling and you just close dead 
connections and open new ones.

If you're using javax.sql.ConnectionPoolDataSource, you'll need to 
inform the connection pool that the connection is dead. How to do so 
depends on the connection pool you're using, so you'd need to provide 
more information. In general, it seems to end up with the connection 
pool calling close() on the PooledConnection associated with the problem 
connection.

See:
   http://java.sun.com/javase/6/docs/api/javax/sql/PooledConnection.html

--
Craig Ringer

In response to

pgsql-jdbc by date

Next:From: Viktor UsunovDate: 2009-12-15 20:10:12
Subject: Bulgarian translation for the PostgreSQL JDBC driver
Previous:From: Craig RingerDate: 2009-12-15 01:57:53
Subject: Re: keeping Connection alive

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group