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 00D685336C for ; Mon, 4 Apr 2005 18:09:27 +0100 (BST) 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 92529-07 for ; Mon, 4 Apr 2005 17:09:18 +0000 (GMT) Received: from mail63.csoft.net (leary3.csoft.net [63.111.22.74]) by svr1.postgresql.org (Postfix) with SMTP id C4E3552957 for ; Mon, 4 Apr 2005 18:09:17 +0100 (BST) Received: (qmail 1894 invoked by uid 1112); 4 Apr 2005 17:09:18 -0000 Date: Mon, 4 Apr 2005 12:09:18 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: "Chris White (cjwhite)" Cc: pgsql-jdbc@postgresql.org Subject: Re: JDBC and transactions In-Reply-To: <200504032239.j33MdsgS029843@sj-core-3.cisco.com> Message-ID: References: <200504032239.j33MdsgS029843@sj-core-3.cisco.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.012 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/18 X-Sequence-Number: 12625 On Sun, 3 Apr 2005, Chris White (cjwhite) wrote: > So I should setAutoCommit(true) after doing the commit to end the > transaction. But won't this waste a transaction, if the next transaction > starts immediately upon the commit? > Well, again that depends on what driver version you are using. 8.0 will not have started a new transaction yet so one will not be used. For 7.4 a transaction indeed will be wasted. You could try and be clever and use setAutoCommit(true) instead of commit() because it will commit your transaction and not start another, but this would be confusing from a readability point at least. Kris Jurka