pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Markus Riehl <mriehl@skat.com>
To: pgsql-jdbc@postgresql.org
Subject: No automatic reconnect after network error
Date: Mon, 10 Apr 2006 17:11:15 +0200
Message-ID: <003301c65cb1$038f0830$15b2a8c0@pcmar02> (raw)

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





view thread (5+ messages)  latest in thread

Message-ID: <003301c65cb1$038f0830$15b2a8c0@pcmar02>
Permalink:  ../003301c65cb1$038f0830$15b2a8c0@pcmar02/
Also on:    postgresql.org/message-id/003301c65cb1$038f0830$15b2a8c0@pcmar02

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: mriehl@skat.com
  Subject: Re: No automatic reconnect after network error
  In-Reply-To: <003301c65cb1$038f0830$15b2a8c0@pcmar02>
  References: <003301c65cb1$038f0830$15b2a8c0@pcmar02>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox