From: Barry Lind <blind@xythos.com>
To: Phil.Hourihane@meridianp2p.com
Cc: pgsql-jdbc@postgresql.org
Subject: Re: java.net.SocketException: Broken pipe
Date: Tue, 23 Sep 2003 09:06:17 -0700
Message-ID: <3F706F79.4020202@xythos.com> (raw)
In-Reply-To: <OFE0B53550.0C7E31BF-ON80256DAA.0034FD9F-80256DAA.0035448A@meridianp2p.com>
References: <OFE0B53550.0C7E31BF-ON80256DAA.0034FD9F-80256DAA.0035448A@meridianp2p.com>
Phil,
Phil.Hourihane@meridianp2p.com wrote:
>>Phil,
>>
>>A possible cause is a firewall or some other device between the client
>>and the server that drops connections after a certain time. (Most
>>firewall don't allow you to keep connections open indefinitely).
>>
>>thanks,
>>--Barry
>
>
> Thanks, Barrry, for your reply.
>
> Unfortunately, I don't think this is my problem.There is no firewall in
> place which would prevent a connection from lasting for any
> length of time. In fact, the statement that I am caching is built
> around a connection pool, so that the statement should not
> actually be using the same connection each time it is run at all.
>
Here is your problem. A statement object is owned by a connection. You
cannot cache statement objects across different connections. What will
actually happen is if you later use the statement, it will still be
using the connection that created it, even if you have returned that
connection back to the pool. What I suspect is happening is that your
connection pool is occasionally closing connections and it just so
happens that the connection closed is the one used by your cached
statement. If you want to cache a statement like this, you will also
need to cache the connection that goes with that statement.
thanks,
--Barry
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: blind@xythos.com, Phil.Hourihane@meridianp2p.com
Subject: Re: java.net.SocketException: Broken pipe
In-Reply-To: <3F706F79.4020202@xythos.com>
References: <OFE0B53550.0C7E31BF-ON80256DAA.0034FD9F-80256DAA.0035448A@meridianp2p.com> <3F706F79.4020202@xythos.com>
* 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