Re: Patch for handling "autocommit=false" in postgresql.conf

From: snpe <snpe(at)snpe(dot)co(dot)yu>
To: pgsql-jdbc <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Patch for handling "autocommit=false" in postgresql.conf
Date: 2002-09-17 16:24:21
Message-ID: 200209171824.21683.snpe@snpe.co.yu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Tuesday 17 September 2002 04:26 pm, Tom Lane wrote:
> snpe <snpe(at)snpe(dot)co(dot)yu> writes:
> > + // handle autocommit=false in postgresql.conf
> > + if (haveMinimumServerVersion("7.3")) {
> > + ExecSQL("set autocommit to on; commit;");
> > + }
>
> The above will fill people's logs with
> WARNING: COMMIT: no transaction in progress
> if they don't have autocommit off.
>
> Use
> begin; set autocommit to on; commit;
> instead.
>
> I would recommend holding off on this patch altogether, actually,
> until we decide whether SET will be a transaction-initiating
> command or not. I would still like to persuade the hackers community
> that it should not be.

if set 'begin; setautocommit to on; commit;'
this is work no matter autocommit on or off and whether SET initiate
transaction or not.
We can yet query database for transaction (on or off), but this is not
important (we must autocommit=true for jdbc spec).

regards
haris peco

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Al Sutton 2002-09-17 19:05:24 JDBC API Tests
Previous Message Andrew Sullivan 2002-09-17 15:12:54 Re: NOTICE causing SQLException