Thread: PooledConnectionImpl should call connectionErrorOccurred on listeners on connection error (per spec)

Hi all,

The current implementation of the "PooledConnectionImpl" is not calling
the connectionErrorOccurred callback on the registered listeners, as it
is required by the JDBC spec.
Our connection pool implementation uses that callback to mark the
connection as invalid, and remove it from the pool.
You can test the behavior if you set up a connection pool, start up your
app server, and then restart the postgres server, and try to access the
database.
If the connection pool implementation doesn't have some special code to
detect connection failure, the already created PooledConnections will be
unusable, but the connectionErrorOccurred callback will never be called.
This can be worked around in the connection pool implementation, but is
not conforming to the spec.
I've attached a patch which will just simply call the callback method
before throwing exceptions in the "getConnection" method.
Please apply the patch if it makes sens to you too...

Thanks,
Csaba.



Patch attached

From
Csaba Nagy
Date:
Silly me, I've forgot to attach the patch...

Cheers,
Csaba.


Attachment

Re: Patch attached applied

From
Dave Cramer
Date:
Patch has been applied to HEAD, it didn't work for 7.2.3

Thanks,

Dave
On Thu, 2003-03-20 at 12:01, Csaba Nagy wrote:
> Silly me, I've forgot to attach the patch...
>
> Cheers,
> Csaba.
>
>
> ______________________________________________________________________
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
--
Dave Cramer <Dave@micro-automation.net>