No automatic reconnect after network error

From: "Markus Riehl" <mriehl(at)skat(dot)com>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: No automatic reconnect after network error
Date: 2006-04-10 15:11:15
Message-ID: 003301c65cb1$038f0830$15b2a8c0@pcmar02
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi all,

JDBC Version: 8.1-405 (Type 3)
Postgre SQL Version: 8.1.3
OS: Windows XP

I have the PSQL database running on one server, my java application on
another server. The java application is a server application that opens a
database connection once at startup time.

The server application uses PreparedStatements (threshold=0) that are also
created at startup time.

After a network error (to test I removed the network cable from the server
where my java application is running for a few seconds), I get the following
error message when using on of the PreparedStatements:

org.postgresql.util.PSQLException: An I/O error occured while sending to the
backend.
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:214)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.j
ava:437)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2St
atement.java:353)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statem
ent.java:257)
...

Using MySQL or SAPDB, the JDBC driver is automatically reconnecting to the
database when the connection is up again. Is there a way to use the PSQL
driver the same way?

How is this problem handled within Connection Pools (used within a servlet
environment)? Is the pool deleting "dead" connections automatically and is
creating new ones?

Thanks in advance

Markus

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Markus Schaber 2006-04-10 15:53:30 Re: No automatic reconnect after network error
Previous Message Markus Schaber 2006-04-10 10:22:54 Re: Re; pg_dump from Java