No automatic reconnect after network error - Mailing list pgsql-jdbc

From Markus Riehl
Subject No automatic reconnect after network error
Date
Msg-id 003301c65cb1$038f0830$15b2a8c0@pcmar02
Whole thread Raw
Responses Re: No automatic reconnect after network error  (Markus Schaber <schabi@logix-tt.com>)
List 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



pgsql-jdbc by date:

Previous
From: Markus Schaber
Date:
Subject: Re: Re; pg_dump from Java
Next
From: Markus Schaber
Date:
Subject: Re: No automatic reconnect after network error