Home > Archive > PostgreSQL JDBC > April 2005 > An I/O error occured while sending to the backend









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author An I/O error occured while sending to the backend
Anthony Chaffey

2005-04-06, 7:02 am

Hi,


I have developed an application using the postgresql-8.0-310.jdbc3
driver and connecting to a postgresql 8.0.1 database running on fedora
core 3. Everything was working fine until i started running the
application on the clients pc's. Randomly they receive an error, the
stack trace of which is below.

The only difference between my testing pc and the client's pc's is that
they use a wireless network card. Both my machine and the client's pc's
are running Windows XP with SP2. Similar problems have been posted on
this mailing list and people have suggested a firewall is clearing the
connection which makes sense as the client claims this problem only
occurs if the application is left idle for a short time but does anyone
have any more information that may help?

Thanks for any help.

Anthony.

Stack Trace:

org.postgresql.util.PSQLException: An I/O error occured while sending to
the backend.
at
org.postgresql.core.v3.QueryExecutorImpl. execute(QueryExecuto
rImpl.java:
201)
at
org.postgresql.jdbc2. AbstractJdbc2Stateme
nt. execute(AbstractJdbc
2Stateme
nt.java:388)
at
org.postgresql.jdbc2. AbstractJdbc2Stateme
nt. executeWithFlags(Abs
tractJdb
c2Statement.java:313)
at
org.postgresql.jdbc2. AbstractJdbc2Stateme
nt. executeQuery(Abstrac
tJdbc2St
atement.java:220)
......
at javax.swing.AbstractButton. fireActionPerformed(
Unknown Source)
at javax.swing. AbstractButton$Handl
er. actionPerformed(Unkn
own Source)
at javax.swing.DefaultButtonModel. fireActionPerformed(
Unknown Source)
at javax.swing. JToggleButton$Toggle
ButtonModel.setPressed(Unknown
Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at javax.swing.plaf.basic. BasicMenuItemUI$Hand
ler. mouseReleased(Unknow
n
Source)
at java.awt.Component. processMouseEvent(Un
known Source)
at javax.swing.JComponent. processMouseEvent(Un
known Source)
at java.awt.Component. processEvent(Unknown
Source)
at java.awt.Container. processEvent(Unknown
Source)
at java.awt.Component. dispatchEventImpl(Un
known Source)
at java.awt.Container. dispatchEventImpl(Un
known Source)
at java.awt.Component. dispatchEvent(Unknow
n Source)
at java.awt. LightweightDispatche
r. retargetMouseEvent(U
nknown Source)
at java.awt. LightweightDispatche
r. processMouseEvent(Un
known Source)
at java.awt. LightweightDispatche
r. dispatchEvent(Unknow
n Source)
at java.awt.Container. dispatchEventImpl(Un
known Source)
at java.awt.Window. dispatchEventImpl(Un
known Source)
at java.awt.Component. dispatchEvent(Unknow
n Source)
at java.awt.EventQueue. dispatchEvent(Unknow
n Source)
at java.awt.EventDispatchThread. pumpOneEventForHiera
rchy(Unknown
Source)
at java.awt.EventDispatchThread. pumpEventsForHierarc
hy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.io.EOFException
at org.postgresql.core.PGStream. ReceiveChar(PGStream
.java:243)
at
org.postgresql.core.v3.QueryExecutorImpl. processResults(Query
ExecutorImp
l.java:1122)
at
org.postgresql.core.v3.QueryExecutorImpl. execute(QueryExecuto
rImpl.java:
175)
... 35 more

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.3 - Release Date: 05/04/2005


John R Pierce

2005-04-06, 8:03 pm

Anthony Chaffey wrote:
> Hi,
>
>
> I have developed an application using the postgresql-8.0-310.jdbc3
> driver and connecting to a postgresql 8.0.1 database running on fedora
> core 3. Everything was working fine until i started running the
> application on the clients pc's. Randomly they receive an error, the
> stack trace of which is below.
>
> The only difference between my testing pc and the client's pc's is that
> they use a wireless network card. Both my machine and the client's pc's
> are running Windows XP with SP2. Similar problems have been posted on
> this mailing list and people have suggested a firewall is clearing the
> connection which makes sense as the client claims this problem only
> occurs if the application is left idle for a short time but does anyone
> have any more information that may help?


its probaly exactly what you say, most firewalls, NAT routers, etc will time
out idle sockets after a certain number of minutes... They have to do this,
otherwise the firewall's connection tracking tables will fill up with old flug.

only good solution is to catch the exception, and attempt to reopen the
database connection, and retry the operation....


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Scott Marlowe

2005-04-06, 8:03 pm

On Wed, 2005-04-06 at 11:24, John R Pierce wrote:
> Anthony Chaffey wrote:
>
> its probaly exactly what you say, most firewalls, NAT routers, etc will time
> out idle sockets after a certain number of minutes... They have to do this,
> otherwise the firewall's connection tracking tables will fill up with old flug.
>
> only good solution is to catch the exception, and attempt to reopen the
> database connection, and retry the operation....


Does setting a lower tcp_keepalive_time help these problems with NAT?
It certainly fixed the problems I've seen with non-NAT firewalls. (this
is a linux kernel setting, i'm sure there's an equivalent for other
unixes)

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Markus Schaber

2005-04-07, 7:02 am

Hi, Scott,

Scott Marlowe schrieb:

[color=darkred]
> Does setting a lower tcp_keepalive_time help these problems with NAT?
> It certainly fixed the problems I've seen with non-NAT firewalls. (this
> is a linux kernel setting, i'm sure there's an equivalent for other
> unixes)


java.net.Socket has some settings about timeouts and keepalives, maybe
those will help.

Markus

Anthony Chaffey

2005-04-07, 7:02 am

Thanks to everyone for their responses.

I have now coded the application to catch the exception an determine
whether it is an i/o problem and attempts to re-connect to the database.
I will look into the socket time-out settings but I have realised that
my solution also holds up well when a network/internet connection is
lost entirely.

Thanks again.

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.4 - Release Date: 06/04/2005


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com