Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: Connection exceptions


  • From: Thomas Finneid <tfinneid(at)fcon(dot)no>
  • To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
  • Cc: pgsql-jdbc(at)postgresql(dot)org
  • Subject: Re: Connection exceptions
  • Date: Sat, 20 Jun 2009 10:44:04 +0200
  • Message-id: <4A3CA154.4090205@fcon.no> <text/plain>


Craig Ringer wrote:
Most of your question really deals with the connection pooler you're
using, rather than JDBC its self. I'd start with the documentation for
DBCP.

I have looked at it, and its really poor, but I'll look for a mailing list to see if I can get answers there.

Not sure if anybody here can answer this question, but one thing I dont understand is the separation between DBCP and the pooler and who do what. Apparently they are two different apache-commons packages. Anybody know anything about these details or where I can find any documentation or articles about it?

shouldn't care at what point in the process the exception was thrown.
When you catch it, you can test the SQLState to see if the error is
possibly transient and be prepared to retry the operation. (deadlocked
transaction? OK, retry. Connection broken? Obtain a new connection and
retry. etc)

My main algorithm is to not care, but as soon as a problem occurs, return the connection to the pool and let the pool deal with its condition, then get a new connection and try again. Repeat three times and then fail by throwing an exception to the client (after appropriate cleanup and logging.)

regards

thomas



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group