From: | Kishore Kolli <kkolli(at)gmail(dot)com> |
---|---|
To: | Jonathan Fuerth <fuerth(at)sqlpower(dot)ca> |
Cc: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: org.postgresql.util.PSQLException: An I/O error has occured while flushing the output |
Date: | 2005-12-12 17:58:35 |
Message-ID: | 6f1412eb0512120958r1ee56d22gc531dca5d7187388@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
Thanks a bunch.. That worked.
-kishore
On 12/9/05, Jonathan Fuerth <fuerth(at)sqlpower(dot)ca> wrote:
>
> On Dec 8, 2005, at 4:58 PM, Kishore Kolli wrote:
>
> > The application dumps the following error in the following cases:
> > 1. The postgres process is restarted.
> > 2. The network connection between the machine running postgres and
> > tomcat has been reset.
> > [...]
> > Any idea how to make tomcat reconnect to the database with out any
> > problems ?
> >
>
> It's not a Postgres specific answer, but here's an answer nonetheless:
>
> It appears from the stack trace that you are using the Jakarta Commons
> DBCP package. If you set a validationQuery on your connection pool,
> the pool manager will automatically test your database connections
> before giving them to Hibernate. If you have had a network outage or
> server restart, the pooled connections will fail that test, and the
> DBCP will dump those broken connections and open new ones before
> returning them to Hibernate.
>
> For your validation, pick a simple query that is guaranteed to return
> at least one row, but will not be expensive to execute (because it will
> be executed frequently!). For example, you could use "SELECT now()",
> which doesn't even require disk access.
>
> See http://jakarta.apache.org/commons/dbcp/configuration.html for
> details on DBCP configuration.
>
> -Jonathan
>
From | Date | Subject | |
---|---|---|---|
Next Message | Heikki Linnakangas | 2005-12-12 19:29:37 | Re: pgsql XA with weblogic 8.1? |
Previous Message | Russell Francis | 2005-12-10 17:25:47 | PGinet, PGcidr & PGmacaddr contributions |