Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 84FA79FB25B for ; Sun, 15 Jul 2007 08:07:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 18756-04 for ; Sun, 15 Jul 2007 08:07:40 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by postgresql.org (Postfix) with ESMTP id 013999FB22E for ; Sun, 15 Jul 2007 08:07:47 -0300 (ADT) Received: from 222-154-131-238.jetstream.xtra.co.nz ([222.154.131.238] helo=[10.1.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1IA1wq-0000rJ-7e; Sun, 15 Jul 2007 23:07:32 +1200 Message-ID: <4699FFF6.4050506@opencloud.com> Date: Sun, 15 Jul 2007 23:07:34 +1200 From: Oliver Jowett User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) MIME-Version: 1.0 To: ecf@goldencode.com CC: pgsql-jdbc@postgresql.org Subject: Re: Implicit autocommit? References: <4699BA51.6050001@goldencode.com> In-Reply-To: <4699BA51.6050001@goldencode.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/55 X-Sequence-Number: 17229 Eric Faulhaber wrote: > I debugged into the driver and found it was issuing a "BEGIN" to the > backend just before each statement. Why would it do this with > autocommit disabled? autocommit on = implicit transaction wrapping each individual statement. In the postgres world, this means "don't use BEGIN/COMMIT at all". autocommit off = explicit transaction demarcation, the first statement executed starts a new transaction that lasts until rollback()/commit() are called. In the postgres world, this means "use BEGIN/ROLLBACK/COMMIT to demarcate the transaction". So the driver issues a BEGIN to start a new transaction as necessary. -O