Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 5CE486335AF for ; Mon, 14 Dec 2009 21:58:13 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 13226-09 for ; Tue, 15 Dec 2009 01:57:54 +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 53997633398 for ; Mon, 14 Dec 2009 21:58:02 -0400 (AST) Received: from localhost (access [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id 6DDBA1E0444; Tue, 15 Dec 2009 09:57:57 +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 dV2RoNF0qHBl; Tue, 15 Dec 2009 09:57:54 +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 04EB01E0440; Tue, 15 Dec 2009 09:57:53 +0800 (WST) Message-ID: <4B26ED21.3010607@postnewspapers.com.au> Date: Tue, 15 Dec 2009 09:57:53 +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.296 tagged_above=-10 required=5 tests=AWL=0.303, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200912/41 X-Sequence-Number: 20122 On 14/12/2009 10:53 PM, Andreas wrote: >> ... where "invalidateConnection(Connection, Throwable)" tells the >> provider/pool that the connection is broken. > > 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? If you're using JNDI to get a DataSource and calling getConnection(...) on it to obtain a JDBC connection, then there's no connection pooling going on. You close your connectoins when you're done with them. So there's no need to tell the DataSource the connection is broken; you just close it and request a new one from the DataSource. I don't currently use JNDI in my own app (though it looks like I should), but I'm pretty sure that's how to handle it. -- Craig Ringer