Re: Getting "This ResultSet is closed" exceptions - Mailing list pgsql-jdbc

From Paul Tomblin
Subject Re: Getting "This ResultSet is closed" exceptions
Date
Msg-id 8efd35820802181148o3325551fj2f4f7de7baab39a1@mail.gmail.com
Whole thread Raw
In response to Re: Getting "This ResultSet is closed" exceptions  ("Andres Olarte" <olarte.andres@gmail.com>)
Responses Re: Getting "This ResultSet is closed" exceptions
Re: Getting "This ResultSet is closed" exceptions
List pgsql-jdbc
On Feb 18, 2008 2:10 PM, Andres Olarte <olarte.andres@gmail.com> wrote:
> You might go for using a single connection per thread.  Works for me.

Forgive a possibly stupid question, but how would a class know whether
there is a Connection for this thread already?  I use a simple static
to hold the Connection, and so I get one for the whole program.  But
there is a lot of asynchronous stuff going on with GUI callbacks,
external "messages" and RMI calls, etc.  Do I have to create and
destroy a connection in every callback, or use some sort of thread
pooling system?  A previous engineer on this project had one subsystem
that was creating a new database connection every second, and then
closing it a few milliseconds later - that seems like madness to me.


--
For my assured failures and derelictions I ask pardon beforehand of my
betters and my equals in my Calling here assembled, praying that in
the hour of my temptations, weakness and weariness, the memory of this
my Obligation and of the company before whom it was entered into, may
return to me to aid, comfort and restrain.

pgsql-jdbc by date:

Previous
From: peter royal
Date:
Subject: Re: Implementing setQueryTimeout()
Next
From: Jan de Visser
Date:
Subject: Re: Getting "This ResultSet is closed" exceptions