Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 7B32F633398 for ; Mon, 14 Dec 2009 22:06:30 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 88425-03 for ; Tue, 15 Dec 2009 02:06:22 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.postnewspapers.com.au (202-89-185-120.static.dsl.amnet.net.au [202.89.185.120]) by mail.postgresql.org (Postfix) with ESMTP id D87F8632D43 for ; Mon, 14 Dec 2009 22:06:22 -0400 (AST) Received: from localhost (access [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id 7418E1E0445; Tue, 15 Dec 2009 10:06:18 +0800 (WST) X-Virus-Scanned: Debian amavisd-new at postnewspapers.com.au Received: from mail.postnewspapers.com.au ([127.0.0.1]) by localhost (access.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Rspp76esqVWA; Tue, 15 Dec 2009 10:06:16 +0800 (WST) Received: from [10.1.1.6] (203-206-103-104.dyn.iinet.net.au [203.206.103.104]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Craig Ringer", Issuer "POST Certificate Authority" (verified OK)) by mail.postnewspapers.com.au (Postfix) with ESMTPSA id 9EF2B1E0440; Tue, 15 Dec 2009 10:06:16 +0800 (WST) Message-ID: <4B26EF18.9060606@postnewspapers.com.au> Date: Tue, 15 Dec 2009 10:06:16 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: Andreas CC: pgsql-jdbc@postgresql.org Subject: Re: keeping Connection alive References: <26903539.10.1260802418802.JavaMail.root@store1.zcs.ext.wpsrv.net> In-Reply-To: <26903539.10.1260802418802.JavaMail.root@store1.zcs.ext.wpsrv.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200912/42 X-Sequence-Number: 20123 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