Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 719A99F9F81 for ; Wed, 15 Aug 2007 11:25:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 06646-07 for ; Wed, 15 Aug 2007 11:25:47 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mir3-fs.mir3.com (mail.mir3.com [65.208.188.100]) by postgresql.org (Postfix) with ESMTP id 7937B9F9E96 for ; Wed, 15 Aug 2007 11:25:47 -0300 (ADT) Received: MIR3-FS.mir3.com 172.16.1.11 from 172.16.2.68 172.16.2.68 via HTTP with MS-WebStorage 6.0.6249 Received: from archimedes by MIR3-FS.mir3.com; 15 Aug 2007 07:25:44 -0700 Subject: Re: autocommit and stored procedures From: Mark Lewis To: Oliver Jowett Cc: roehm@it.usyd.edu.au, pgsql-jdbc@postgresql.org In-Reply-To: <46C30863.3080709@opencloud.com> References: <46C30863.3080709@opencloud.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: MIR3, Inc. Date: Wed, 15 Aug 2007 07:25:44 -0700 Message-Id: <1187187944.23831.28.camel@archimedes> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/68 X-Sequence-Number: 17381 On Thu, 2007-08-16 at 02:06 +1200, Oliver Jowett wrote: > roehm@it.usyd.edu.au wrote: > > > Which command granularity does the JDBC driver's autocommit have? > > Does it commit after each client-side JDBC statement, or does it commit > > each individual SQL statement on the server-side? > > It effectively commits after each client-side JDBC statement execution, > even if you provide multiple semicolon-separated queries in a single > statement. At the protocol level the driver converts a single JDBC > statement into one or more groups of Parse/Bind/Execute messages, > followed by a single Sync. You can see this if you look at the debugging > produced with loglevel=2. Also see > http://www.postgresql.org/docs/8.2/static/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY Did this change with v3 protocol? I'm not positive, but I remember thinking that it used to commit each statement individually quite a while back, but that would have been in the days of the v2 protocol. If that's the case, then maybe using v2 protocol would suffice for executing multiple statements at a time with a single auto-commit? But yeah, none of this really seems to apply to the original poster's question anyway. -- Mark Lewis