X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 338715E46F8 for ; Mon, 23 Aug 2004 11:46:41 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 37815-05 for ; Mon, 23 Aug 2004 14:46:37 +0000 (GMT) Received: from ganymede.hub.org (u46n208.hfx.eastlink.ca [24.222.46.208]) by svr1.postgresql.org (Postfix) with ESMTP id B74325E46F4 for ; Mon, 23 Aug 2004 11:46:30 -0300 (ADT) Received: by ganymede.hub.org (Postfix, from userid 1000) id EFCAE3874D; Mon, 23 Aug 2004 11:46:37 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by ganymede.hub.org (Postfix) with ESMTP id EEC3C38529 for ; Mon, 23 Aug 2004 11:46:37 -0300 (ADT) X-Return-Path: X-Received: from localhost ([unix socket]) by ganymede.hub.org (Cyrus v2.2.8) with LMTPA; Mon, 23 Aug 2004 11:24:42 -0300 X-Sieve: CMU Sieve 2.2 X-Received: from localhost (localhost.hub.org [127.0.0.1]) by ganymede.hub.org (Postfix) with ESMTP id 0A73137C58 for ; Mon, 23 Aug 2004 11:20:59 -0300 (ADT) X-Received: from mail.postgresql.org [200.46.204.71] by localhost with IMAP (fetchmail-6.2.5) for scrappy@localhost (single-drop); Mon, 23 Aug 2004 11:20:59 -0300 (ADT) X-Received: from svr1.postgresql.org ([unix socket]) by svr1.postgresql.org (Cyrus v2.2.8) with LMTPA; Mon, 23 Aug 2004 11:20:32 -0300 X-Sieve: CMU Sieve 2.2 X-Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A7C745E46F4 for ; Mon, 23 Aug 2004 11:20:32 -0300 (ADT) X-Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 23801-06 for ; Mon, 23 Aug 2004 14:20:29 +0000 (GMT) X-Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 2082A5E46F2 for ; Mon, 23 Aug 2004 11:20:25 -0300 (ADT) X-Received: (qmail 32094 invoked from network); 23 Aug 2004 14:20:28 -0000 X-Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 23 Aug 2004 14:20:28 -0000 Subject: Re: Closing ResultSet and Statements From: Dave Cramer Reply-To: pg@fastcrypt.com To: Antony Paul Cc: pgsql-jdbc In-Reply-To: References: Content-Type: text/plain Organization: Cramer Consulting Message-Id: <1093270921.20388.139.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Mon, 23 Aug 2004 10:22:01 -0400 Content-Transfer-Encoding: 7bit X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-DCC: : ganymede.hub.org 1074; Body=1 Fuz1=1 Fuz2=1 X-Spam-Pyzor: Reported 0 times. ReSent-Date: Mon, 23 Aug 2004 11:46:34 -0300 (ADT) Resent-From: "Marc G. Fournier" Resent-To: pgsql-jdbc@postgresql.org ReSent-Subject: Re: [JDBC] Closing ResultSet and Statements ReSent-Message-ID: <20040823114634.Y4215@ganymede.hub.org> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/132 X-Sequence-Number: 10854 Most of these questions have nothing to do with pg, but jdbc in general. On Mon, 2004-08-23 at 04:24, Antony Paul wrote: > Hi all, > (Sorry if repost. I posted it some days ago but couldn't found on the list) > 1. Is it necessary to close all ResultSet and Statements in PostgreSQL. It is generally very good form to close them, however if you close the statement, the result set will be closed, as per the jdbc spec. > 2. How to know that a ResultSet is open ?. Any views to query this > information?. not really, you either get null from the Statement.execute, or an open result set > 3. Do closing a Statement closes the ResultSet ?. yes, as per spec > 4. I saw an option of autocommit = true in the postgresql.conf file. What > is its use. to set autocommit to false, but I would not expect the driver to function well, I seriously doubt if anyone has tested this thoroughly. > What is the default behaviour if it is commented. if it is commented that is the default > If I set this > to true do I have commit on all connections obtained without using a > connection pool ?. If this is true you do not have to commit anything. The way to do this in jdbc is to use Connection.setAutoCommt(false|true); > > rgds > Antony Paul > > > ---------------------------(end of broadcast)--------------------------- > TIP 8: explain analyze is your friend > -- Dave Cramer 519 939 0336 ICQ # 14675561 www.postgresintl.com