pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Stéphane RIFF <stephane.riff@cerene.fr>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Connection pool problem
Date: Wed, 02 Mar 2005 00:49:59 +1300
Message-ID: <422456E7.8060303@opencloud.com> (raw)
In-Reply-To: <42242041.8030604@cerene.fr>
References: <42242041.8030604@cerene.fr>

Stéphane RIFF wrote:

> I've create a connection pool with dbcp end another with 
> Jdbc3PoolingDatasource,
> it seems to work well but :
> My pool is a eight connections pool, the problem is when i get some 
> database exception (for example
> "constraint violation", "duplicate key on unique index"...) the 
> connection didn't released to the pool.
> After eight exception my application wait for a connection from the pool 
> which nerver give one because
> of the PSQLException thrown.

Perhaps your code does not release the connection to the pool correctly 
when handling the exception?

The usual way to deal with this is to put connection releasing in a 
finally block, so it's sure to be run however you exit the try{} block.

If it's not that, I'd need to see your code to debug this further.

-O



view thread (9+ messages)  latest in thread

Message-ID: <422456E7.8060303@opencloud.com>
Permalink:  ../422456E7.8060303@opencloud.com/
Also on:    postgresql.org/message-id/422456E7.8060303@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, stephane.riff@cerene.fr
  Subject: Re: Connection pool problem
  In-Reply-To: <422456E7.8060303@opencloud.com>
  References: <42242041.8030604@cerene.fr> <422456E7.8060303@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