Re: Connection pool problem - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Connection pool problem
Date
Msg-id 422456E7.8060303@opencloud.com
Whole thread Raw
In response to Connection pool problem  (Stéphane RIFF <stephane.riff@cerene.fr>)
Responses Re: Connection pool problem
List pgsql-jdbc
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

pgsql-jdbc by date:

Previous
From: "sandrigo.lezcano@gmail.com"
Date:
Subject: string de conexao em JAVA
Next
From: Dave Cramer
Date:
Subject: Re: impossible to update rows specifying columns with NULL