Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 3BF462E0085 for ; Mon, 18 Feb 2008 15:48:57 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 17665-01-4 for ; Mon, 18 Feb 2008 15:48:49 -0400 (AST) Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.187]) by postgresql.org (Postfix) with ESMTP id 8DCA22E0066 for ; Mon, 18 Feb 2008 15:48:25 -0400 (AST) Received: by fk-out-0910.google.com with SMTP id b27so2110022fka.3 for ; Mon, 18 Feb 2008 11:48:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=ZuxqqJCdvBIE9PH0hc7+V4DZDysJFsQlsWmlV/689O0=; b=G8S/P9PwDgLwU/brmzkNpjDVDVNexakPXyVDHozH/3j0Gs6dESzvLaCmAir9qeL/tR/DSNhVPpRSBxy2tBynwzx8UIRNKoojSzM32FQBPknf//17aX+JqdAquKH1bkuCeiGa7KUIlzHBeQPk6GtLQyC5EXi7rAIqI49SV+mdq2U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=E3oB+YJHaJGyXs+KTOEundWcOJYCQg3SwVACDqBQFXbZ0LtwrxdSAQtASkT+Q2ODteHan2aNkMdfmSVldnCSTkEKfD6S/anHpdh/WPCrc9V4bETD/4NZlGmZcX9arFfUMLoUMjmSHjqOVQFZ7rAUOHldP7XhxsBXkNEuu3E/zmw= Received: by 10.82.149.8 with SMTP id w8mr12554893bud.0.1203364104271; Mon, 18 Feb 2008 11:48:24 -0800 (PST) Received: by 10.82.180.9 with HTTP; Mon, 18 Feb 2008 11:48:24 -0800 (PST) Message-ID: <8efd35820802181148o3325551fj2f4f7de7baab39a1@mail.gmail.com> Date: Mon, 18 Feb 2008 14:48:24 -0500 From: "Paul Tomblin" To: pgsql-jdbc@postgresql.org Subject: Re: Getting "This ResultSet is closed" exceptions In-Reply-To: <3fccaa690802181110j4b5d1429ta8ea641f4ebb160@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <8efd35820802180619l352d9b0eta35788642a5fc4eb@mail.gmail.com> <3fccaa690802181051r377afa2an33fb9e1a3a7b65ca@mail.gmail.com> <8efd35820802181059x45bf1f0el712930cffa58ed6@mail.gmail.com> <3fccaa690802181110j4b5d1429ta8ea641f4ebb160@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200802/125 X-Sequence-Number: 18332 On Feb 18, 2008 2:10 PM, Andres Olarte 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.