pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <craig@postnewspapers.com.au>
To: Andreas <ml@3.141592654.de>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: keeping Connection alive
Date: Tue, 15 Dec 2009 10:06:16 +0800
Message-ID: <4B26EF18.9060606@postnewspapers.com.au> (raw)
In-Reply-To: <26903539.10.1260802418802.JavaMail.root@store1.zcs.ext.wpsrv.net>
References: <26903539.10.1260802418802.JavaMail.root@store1.zcs.ext.wpsrv.net>

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



view thread (12+ messages)  latest in thread

Message-ID: <4B26EF18.9060606@postnewspapers.com.au>
Permalink:  ../4B26EF18.9060606@postnewspapers.com.au/
Also on:    postgresql.org/message-id/4B26EF18.9060606@postnewspapers.com.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: craig@postnewspapers.com.au, ml@3.141592654.de
  Subject: Re: keeping Connection alive
  In-Reply-To: <4B26EF18.9060606@postnewspapers.com.au>
  References: <26903539.10.1260802418802.JavaMail.root@store1.zcs.ext.wpsrv.net> <4B26EF18.9060606@postnewspapers.com.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox