pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Kris Jurka <books@ejurka.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Removing our datasource/pooling implementation.
Date: Wed, 12 Jan 2005 12:44:04 +1300
Message-ID: <41E464C4.6060904@opencloud.com> (raw)
In-Reply-To: <Pine.BSO.4.56.0501111743320.28776@leary.csoft.net>
References: <Pine.BSO.4.56.0501052340370.3195@leary.csoft.net>
	<41DDAE01.7030405@opencloud.com>
	<Pine.BSO.4.56.0501102231430.25062@leary.csoft.net>
	<41E44DD6.2080809@opencloud.com>
	<Pine.BSO.4.56.0501111743320.28776@leary.csoft.net>

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



view thread (13+ messages)  latest in thread

Message-ID: <41E464C4.6060904@opencloud.com>
Permalink:  ../41E464C4.6060904@opencloud.com/
Also on:    postgresql.org/message-id/41E464C4.6060904@opencloud.com

 · 

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: oliver@opencloud.com, books@ejurka.com
  Subject: Re: Removing our datasource/pooling implementation.
  In-Reply-To: <41E464C4.6060904@opencloud.com>
  References: <Pine.BSO.4.56.0501052340370.3195@leary.csoft.net> <41DDAE01.7030405@opencloud.com> <Pine.BSO.4.56.0501102231430.25062@leary.csoft.net> <41E44DD6.2080809@opencloud.com> <Pine.BSO.4.56.0501111743320.28776@leary.csoft.net> <41E464C4.6060904@opencloud.com>

* 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