X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 44EBF3A5AE3 for ; Tue, 11 Jan 2005 23:44:20 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 03034-05 for ; Tue, 11 Jan 2005 23:44:08 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 9D96C3A5AFF for ; Tue, 11 Jan 2005 23:44:09 +0000 (GMT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1CoVgF-0004Pz-00; Wed, 12 Jan 2005 12:44:07 +1300 Message-ID: <41E464C4.6060904@opencloud.com> Date: Wed, 12 Jan 2005 12:44:04 +1300 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0 (X11/20041228) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kris Jurka Cc: pgsql-jdbc@postgresql.org Subject: Re: Removing our datasource/pooling implementation. References: <41DDAE01.7030405@opencloud.com> <41E44DD6.2080809@opencloud.com> In-Reply-To: X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.003 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200501/85 X-Sequence-Number: 11965 Kris Jurka wrote: > First I don't use our PooledConnection and I'm also a little unclear on > whose resposibility (CPDS vs the actual pool) certain things are, so this > is just a combination of anecdotes and looking at the code. Nothing is > really broken for normal use, but when something goes wrong there is very > little error detection and fallback. Specifically when a connection to > the database server is lost via a server restart or even potentially user > level code Statement.execute("SET client_encoding TO 'LATIN1'); the dead > connection is not destroyed and will keep being given to clients. The CPDS/PooledConnection has the responsibility for creating connection proxy objects and reporting proxy connection closes and connection fatal errors via a connection listener. The actual pool is responsible for things like pool size, max idle time, whether to recheck connections periodically, etc. Looking at the code, it looks like fireConnectionFatalError() isn't being called in the normal execution (non-setup) path at all. If it was being called, then connection pools would have a chance to see the error via a connection listener and discard the bad connection. I will look at fixing this. Probably the best way to do it is monitor the SQLState of thrown exceptions in the InvocationHandler and know about which states are fatal (e.g. connection failure, driver internal errors). -O